summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki2/basiclayout.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2015-06-05 14:06:02 -0400
committerChris McDonough <chrism@plope.com>2015-06-05 14:06:02 -0400
commitf3c67a4217504bc7f2862ec1616342240738efae (patch)
tree9e7452b3ffdc8d4f30739cfc9d898169d6719206 /docs/tutorials/wiki2/basiclayout.rst
parent7b4ed3088af03de473ad164c314062c283afce39 (diff)
parentc1dbb5092d486df5d7fbad8e52cd1dbcc2c834d9 (diff)
downloadpyramid-f3c67a4217504bc7f2862ec1616342240738efae.tar.gz
pyramid-f3c67a4217504bc7f2862ec1616342240738efae.tar.bz2
pyramid-f3c67a4217504bc7f2862ec1616342240738efae.zip
Merge branch 'master' of github.com:Pylons/pyramid
Diffstat (limited to 'docs/tutorials/wiki2/basiclayout.rst')
-rw-r--r--docs/tutorials/wiki2/basiclayout.rst17
1 files changed, 9 insertions, 8 deletions
diff --git a/docs/tutorials/wiki2/basiclayout.rst b/docs/tutorials/wiki2/basiclayout.rst
index 05781c044..623882516 100644
--- a/docs/tutorials/wiki2/basiclayout.rst
+++ b/docs/tutorials/wiki2/basiclayout.rst
@@ -4,16 +4,17 @@ Basic Layout
The starter files generated by the ``alchemy`` scaffold are very basic, but
they provide a good orientation for the high-level patterns common to most
-:term:`url dispatch` -based :app:`Pyramid` projects.
+:term:`URL dispatch`-based :app:`Pyramid` projects.
-Application Configuration with ``__init__.py``
+Application configuration with ``__init__.py``
----------------------------------------------
A directory on disk can be turned into a Python :term:`package` by containing
an ``__init__.py`` file. Even if empty, this marks a directory as a Python
-package. We use ``__init__.py`` both as a marker indicating the directory
-it's contained within is a package, and to contain configuration code.
+package. We use ``__init__.py`` both as a marker, indicating the directory
+in which it's contained is a package, and to contain application configuration
+code.
Open ``tutorial/tutorial/__init__.py``. It should already contain
the following:
@@ -114,7 +115,7 @@ used when the URL is ``/``:
:lines: 19
:language: py
-Since this route has a ``pattern`` equalling ``/`` it is the route that will
+Since this route has a ``pattern`` equaling ``/`` it is the route that will
be matched when the URL ``/`` is visited, e.g. ``http://localhost:6543/``.
``main`` next calls the ``scan`` method of the configurator
@@ -136,7 +137,7 @@ Finally, ``main`` is finished configuring things, so it uses the
:lines: 21
:language: py
-View Declarations via ``views.py``
+View declarations via ``views.py``
----------------------------------
The main function of a web framework is mapping each URL pattern to code (a
@@ -167,7 +168,7 @@ Note that ``my_view()`` accepts a single argument named ``request``. This is
the standard call signature for a Pyramid :term:`view callable`.
Remember in our ``__init__.py`` when we executed the
-:meth:`pyramid.config.Configurator.scan` method, i.e. ``config.scan()``? The
+:meth:`pyramid.config.Configurator.scan` method ``config.scan()``? The
purpose of calling the scan method was to find and process this
``@view_config`` decorator in order to create a view configuration within our
application. Without being processed by ``scan``, the decorator effectively
@@ -175,7 +176,7 @@ does nothing. ``@view_config`` is inert without being detected via a
:term:`scan`.
The sample ``my_view()`` created by the scaffold uses a ``try:`` and ``except:``
-clause, to detect if there is a problem accessing the project database and
+clause to detect if there is a problem accessing the project database and
provide an alternate error response. That response will include the text
shown at the end of the file, which will be displayed in the browser to
inform the user about possible actions to take to solve the problem.