commit | author | age
|
b1b922
|
1 |
================= |
PE |
2 |
Tutorial Approach |
|
3 |
================= |
|
4 |
|
b61a8b
|
5 |
This tutorial uses conventions to keep the introduction focused and concise. |
SP |
6 |
Details, references, and deeper discussions are mentioned in "See also" notes. |
b1b922
|
7 |
|
2033ee
|
8 |
.. seealso:: This is an example "See also" note. |
b1b922
|
9 |
|
b61a8b
|
10 |
|
SP |
11 |
Directory tree |
b1b922
|
12 |
============== |
b00c4e
|
13 |
|
SP |
14 |
This "Getting Started" tutorial is broken into independent steps, starting with |
|
15 |
the smallest possible "single file WSGI app" example. Each of these steps |
|
16 |
introduces a topic and a very small set of concepts via working code. The steps |
|
17 |
each correspond to a directory in our workspace, where each step's directory is |
e6581f
|
18 |
a Python package. Source code used in this tutorial is located in the `Pyramid repository in the directory "docs/quick_tutorial" <https://github.com/Pylons/pyramid/>`_. You may ``git clone`` the repository, download, or copy-paste the source code. If you do so, then make sure you use the same branch as this documentation. |
b1b922
|
19 |
|
b61a8b
|
20 |
As we develop our tutorial, our directory tree will resemble the structure |
SP |
21 |
below: |
b1b922
|
22 |
|
b61a8b
|
23 |
.. code-block:: text |
b1b922
|
24 |
|
b61a8b
|
25 |
quick_tutorial |
b1c8eb
|
26 |
├── env |
SP |
27 |
└── request_response |
|
28 |
├── tutorial |
|
29 |
│ ├── __init__.py |
|
30 |
│ ├── tests.py |
|
31 |
│ └── views.py |
|
32 |
├── development.ini |
|
33 |
└── setup.py |
b61a8b
|
34 |
|
b00c4e
|
35 |
Each of the directories in our ``quick_tutorial`` workspace (e.g., ``request_response``) is a *Python |
789a90
|
36 |
project* (except as noted for the ``hello_world`` step). The ``tutorial`` |
b00c4e
|
37 |
directory is a *Python package*. |
SP |
38 |
|
3a943e
|
39 |
For most steps you will copy an earlier step's directory to a new directory, change your working directory to the new directory, then install your project: |
b00c4e
|
40 |
|
SP |
41 |
.. code-block:: bash |
|
42 |
|
5593c0
|
43 |
cd ..; cp -r package ini; cd ini |
SP |
44 |
$VENV/bin/pip install -e . |
b00c4e
|
45 |
|
3a943e
|
46 |
For a few steps, you won't copy an earlier step's directory, but you will still need to install your project with ``$VENV/bin/pip install -e .``. |
SP |
47 |
|
23fbca
|
48 |
Finally for a few steps, you might add a dependency to your project in its ``setup.py`` file, and then install both the dependency and the project with either ``$VENV/bin/pip install -e .`` or ``$VENV/bin/pip install -e ".[dev]"``. |