diff options
| author | Michael Merickel <github@m.merickel.org> | 2018-08-21 01:44:55 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-21 01:44:55 -0500 |
| commit | 820a752645b460ea8009b07a75c752ab09c53dec (patch) | |
| tree | 14616d81a7abedfe523c057e71ed7b2aca680754 /docs/quick_tour.rst | |
| parent | df8598a2658632f709a64e8076cce02ca49de8e6 (diff) | |
| parent | 254710cb716dccfe536b20d077e3cb79be19c6b3 (diff) | |
| download | pyramid-820a752645b460ea8009b07a75c752ab09c53dec.tar.gz pyramid-820a752645b460ea8009b07a75c752ab09c53dec.tar.bz2 pyramid-820a752645b460ea8009b07a75c752ab09c53dec.zip | |
Merge pull request #3330 from stevepiercy/docs-code-style
Docs code style
Diffstat (limited to 'docs/quick_tour.rst')
| -rw-r--r-- | docs/quick_tour.rst | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/docs/quick_tour.rst b/docs/quick_tour.rst index db0da3282..6c240da1a 100644 --- a/docs/quick_tour.rst +++ b/docs/quick_tour.rst @@ -55,7 +55,7 @@ For Windows: Of course Pyramid runs fine on Python 2.7+, as do the examples in this *Quick Tour*. We're showing Python 3 for simplicity. (Pyramid had production support for Python 3 in October 2011.) Also for simplicity, the remaining examples will -show only UNIX commands. +show only Unix commands. .. seealso:: See also: :ref:`Quick Tutorial section on Requirements <qtut_requirements>`, @@ -133,7 +133,7 @@ included in the body of the response: .. code-block:: text - URL http://localhost:6543/?name=alice with name: alice + URL http://localhost:6543/?name=alice with name: alice Finally we set the response's content type, and return the Response. @@ -263,7 +263,7 @@ Chameleon as a :term:`renderer` in our Pyramid application: .. code-block:: bash - $ $VENV/bin/pip install pyramid_chameleon + $VENV/bin/pip install pyramid_chameleon With the package installed, we can include the template bindings into our configuration in ``app.py``: @@ -309,7 +309,7 @@ Jinja2 as a :term:`renderer` in our Pyramid applications: .. code-block:: bash - $ $VENV/bin/pip install pyramid_jinja2 + $VENV/bin/pip install pyramid_jinja2 With the package installed, we can include the template bindings into our configuration: @@ -504,13 +504,13 @@ First you'll need to install cookiecutter. .. code-block:: bash - $ $VENV/bin/pip install cookiecutter + $VENV/bin/pip install cookiecutter Let's use the cookiecutter ``pyramid-cookiecutter-starter`` to create a starter Pyramid project in the current directory, entering values at the prompts as shown below for the following command. .. code-block:: bash - $ $VENV/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-starter --checkout master + $VENV/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-starter --checkout master If prompted for the first item, accept the default ``yes`` by hitting return. @@ -531,15 +531,15 @@ We then run through the following commands. .. code-block:: bash # Change directory into your newly created project. - $ cd hello_world + cd hello_world # Create a new virtual environment... - $ python3 -m venv env + python3 -m venv env # ...where we upgrade packaging tools... - $ env/bin/pip install --upgrade pip setuptools + env/bin/pip install --upgrade pip setuptools # ...and into which we install our project and its testing requirements. - $ env/bin/pip install -e ".[testing]" + env/bin/pip install -e ".[testing]" # Reset our environment variable for a new virtual environment. - $ export VENV=~/hello_world/env + export VENV=~/hello_world/env We are moving in the direction of a full-featured Pyramid project, with a proper setup for Python standards (packaging) and Pyramid configuration. This @@ -547,7 +547,7 @@ includes a new way of running your application: .. code-block:: bash - $ $VENV/bin/pserve development.ini + $VENV/bin/pserve development.ini Let's look at ``pserve`` and configuration in more depth. @@ -574,7 +574,7 @@ the server when they change: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload The ``pserve`` command has a number of other options and operations. Most of the work, though, comes from your project's wiring, as expressed in the @@ -654,7 +654,7 @@ It was installed when you previously ran: .. code-block:: bash - $ $VENV/bin/pip install -e ".[testing]" + $VENV/bin/pip install -e ".[testing]" The ``pyramid_debugtoolbar`` package is a Pyramid add-on, which means we need to include its configuration into our web application. The cookiecutter already took care of this for us in its ``development.ini`` using the ``pyramid.includes`` facility: @@ -701,7 +701,7 @@ We already installed the test requirements when we ran the command ``$VENV/bin/p .. code-block:: bash - $ $VENV/bin/py.test --cov --cov-report=term-missing + $VENV/bin/py.test --cov --cov-report=term-missing This yields the following output. @@ -857,8 +857,8 @@ Pyramid and SQLAlchemy are great friends. That friendship includes a cookiecutte .. code-block:: bash - $ cd ~ - $ env/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-alchemy --checkout master + cd ~ + env/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-alchemy --checkout master If prompted for the first item, accept the default ``yes`` by hitting return. @@ -874,15 +874,15 @@ We then run through the following commands as before. .. code-block:: bash # Change directory into your newly created project. - $ cd sqla_demo + cd sqla_demo # Create a new virtual environment... - $ python3 -m venv env + python3 -m venv env # ...where we upgrade packaging tools... - $ env/bin/pip install --upgrade pip setuptools + env/bin/pip install --upgrade pip setuptools # ...and into which we install our project and its testing requirements. - $ env/bin/pip install -e ".[testing]" + env/bin/pip install -e ".[testing]" # Reset our environment variable for a new virtual environment. - $ export VENV=~/sqla_demo/env + export VENV=~/sqla_demo/env We now have a working sample SQLAlchemy application with all dependencies installed. The sample project provides a console script to initialize a SQLite @@ -890,8 +890,8 @@ database with tables. Let's run it, then start the application: .. code-block:: bash - $ $VENV/bin/initialize_sqla_demo_db development.ini - $ $VENV/bin/pserve development.ini + $VENV/bin/initialize_sqla_demo_db development.ini + $VENV/bin/pserve development.ini The ORM eases the mapping of database structures into a programming language. SQLAlchemy uses "models" for this mapping. The cookiecutter generated a sample |
