diff options
| author | Chris McDonough <chrism@plope.com> | 2015-05-19 10:14:13 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2015-05-19 10:14:13 -0400 |
| commit | 61889c275a2f80d36ac903503185942c5573446f (patch) | |
| tree | c5a11fe6d7b908b6557f1799516ead3355c56ef6 /docs/quick_tutorial | |
| parent | d2c49d66399e8caa0509822cab189c04d3f7ec35 (diff) | |
| parent | d43ebd35f288edddb6df9bef3d671735e1dfb124 (diff) | |
| download | pyramid-61889c275a2f80d36ac903503185942c5573446f.tar.gz pyramid-61889c275a2f80d36ac903503185942c5573446f.tar.bz2 pyramid-61889c275a2f80d36ac903503185942c5573446f.zip | |
Merge branch 'master' of github.com:Pylons/pyramid
Diffstat (limited to 'docs/quick_tutorial')
| -rw-r--r-- | docs/quick_tutorial/authorization.rst | 2 | ||||
| -rw-r--r-- | docs/quick_tutorial/logging.rst | 19 | ||||
| -rw-r--r-- | docs/quick_tutorial/requirements.rst | 36 | ||||
| -rw-r--r-- | docs/quick_tutorial/static_assets.rst | 2 | ||||
| -rw-r--r-- | docs/quick_tutorial/views.rst | 2 |
5 files changed, 33 insertions, 28 deletions
diff --git a/docs/quick_tutorial/authorization.rst b/docs/quick_tutorial/authorization.rst index 6b10d3409..dc159234c 100644 --- a/docs/quick_tutorial/authorization.rst +++ b/docs/quick_tutorial/authorization.rst @@ -93,7 +93,7 @@ In summary: ``hello`` wants ``edit`` permission, ``Root`` says Of course, this only applies on ``Root``. Some other part of the site (a.k.a. *context*) might have a different ACL. -If you are not logged in and visit ``/hello``, you need to get +If you are not logged in and visit ``/howdy``, you need to get shown the login screen. How does Pyramid know what is the login page to use? We explicitly told Pyramid that the ``login`` view should be used by decorating the view with ``@forbidden_view_config``. diff --git a/docs/quick_tutorial/logging.rst b/docs/quick_tutorial/logging.rst index e07d23d6d..82cfbe3c3 100644 --- a/docs/quick_tutorial/logging.rst +++ b/docs/quick_tutorial/logging.rst @@ -42,6 +42,12 @@ Steps .. literalinclude:: logging/tutorial/views.py :linenos: +#. Finally let's edit ``development.ini`` configuration file + to enable logging for our Pyramid application: + + .. literalinclude:: logging/development.ini + :language: ini + #. Make sure the tests still pass: .. code-block:: bash @@ -61,15 +67,10 @@ Steps Analysis ======== -Our ``development.ini`` configuration file wires up Python standard -logging for our Pyramid application: - -.. literalinclude:: logging/development.ini - :language: ini - -In this, our ``tutorial`` Python package is setup as a logger -and configured to log messages at a ``DEBUG`` or higher level. When you -visit http://localhost:6543 your console will now show:: +In our configuration file ``development.ini``, our ``tutorial`` Python +package is setup as a logger and configured to log messages at a +``DEBUG`` or higher level. When you visit http://localhost:6543 your +console will now show:: 2013-08-09 10:42:42,968 DEBUG [tutorial.views][MainThread] In home view diff --git a/docs/quick_tutorial/requirements.rst b/docs/quick_tutorial/requirements.rst index b5778ea42..a737ede0e 100644 --- a/docs/quick_tutorial/requirements.rst +++ b/docs/quick_tutorial/requirements.rst @@ -58,11 +58,8 @@ Steps Install Python 3.3 or greater ----------------------------- -Download the latest standard Python 3.3+ release (not development -release) from -`python.org <http://www.python.org/download/releases/>`_. On that page, you -must click the latest version, then scroll down to the "Downloads" section -for your operating system. +Download the latest standard Python 3.3+ release (not development release) +from `python.org <https://www.python.org/downloads/>`_. Windows and Mac OS X users can download and run an installer. @@ -73,8 +70,7 @@ directions. Make sure you get the proper 32- or 64-bit build and Python version. Linux users can either use their package manager to install Python 3.3 -or may -`build Python 3.3 from source +or may `build Python 3.3 from source <http://pyramid.readthedocs.org/en/master/narr/install.html#package-manager- method>`_. @@ -86,13 +82,21 @@ Create a project directory structure We will arrive at a directory structure of ``workspace->project->package``, with our workspace named -``quick_tutorial``. The following diagram shows how this is structured -and where our virtual environment will reside: - -.. figure:: ../_static/directory_structure_pyramid.png - :alt: Final directory structure - - Final directory structure. +``quick_tutorial``. The following tree diagram shows how this will be +structured and where our virtual environment will reside as we proceed through +the tutorial: + +.. code-block:: text + + └── ~ + └── projects + └── quick_tutorial + ├── env + └── step_one + ├── intro + │ ├── __init__.py + │ └── app.py + └── setup.py For Linux, the commands to do so are as follows: @@ -136,11 +140,11 @@ environment. We set an environment variable to save typing later. .. code-block:: bash # Mac and Linux - $ export VENV=~/projects/quick_tutorial/env33/ + $ export VENV=~/projects/quick_tutorial/env # Windows # TODO: This command does not work - c:\> set VENV=c:\projects\quick_tutorial\env33 + c:\> set VENV=c:\projects\quick_tutorial\env .. _create-a-virtual-environment: diff --git a/docs/quick_tutorial/static_assets.rst b/docs/quick_tutorial/static_assets.rst index 19d33f00f..3a7496ec7 100644 --- a/docs/quick_tutorial/static_assets.rst +++ b/docs/quick_tutorial/static_assets.rst @@ -25,7 +25,7 @@ Steps $ cd ..; cp -r view_classes static_assets; cd static_assets $ $VENV/bin/python setup.py develop -#. We add a call ``config.add_static_view in +#. We add a call ``config.add_static_view`` in ``static_assets/tutorial/__init__.py``: .. literalinclude:: static_assets/tutorial/__init__.py diff --git a/docs/quick_tutorial/views.rst b/docs/quick_tutorial/views.rst index 529bba0a4..6728925fd 100644 --- a/docs/quick_tutorial/views.rst +++ b/docs/quick_tutorial/views.rst @@ -92,7 +92,7 @@ module ``views.py`` which is scanned via ``config.scan('.views')``. We have 2 views, each leading to the other. If you start at http://localhost:6543/, you get a response with a link to the next -view. The ``hello_view`` (available at the URL ``/howdy``) has a link +view. The ``hello`` view (available at the URL ``/howdy``) has a link back to the first view. This step also shows that the name appearing in the URL, |
