summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki/basiclayout.rst
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2020-01-16 10:01:29 -0600
committerGitHub <noreply@github.com>2020-01-16 10:01:29 -0600
commit9c153e1250e00faa06003c10c3a26886489e6210 (patch)
tree0bb4743f9e793e73c5f7a369d5744a1eff2e9c00 /docs/tutorials/wiki/basiclayout.rst
parent912bccb8b715b0249c2c23736c467eaee14a4e3b (diff)
parentcc26acfd29c94036d1c4d9164dba6a2b7792c00a (diff)
downloadpyramid-9c153e1250e00faa06003c10c3a26886489e6210.tar.gz
pyramid-9c153e1250e00faa06003c10c3a26886489e6210.tar.bz2
pyramid-9c153e1250e00faa06003c10c3a26886489e6210.zip
Merge pull request #3557 from mmerickel/security-docs
update docs to use security policy
Diffstat (limited to 'docs/tutorials/wiki/basiclayout.rst')
-rw-r--r--docs/tutorials/wiki/basiclayout.rst35
1 files changed, 21 insertions, 14 deletions
diff --git a/docs/tutorials/wiki/basiclayout.rst b/docs/tutorials/wiki/basiclayout.rst
index 4eb5c4283..c1c762ae4 100644
--- a/docs/tutorials/wiki/basiclayout.rst
+++ b/docs/tutorials/wiki/basiclayout.rst
@@ -57,7 +57,7 @@ Next in ``main``, construct a :term:`Configurator` object using a context manage
See also :term:`Deployment settings`.
.. literalinclude:: src/basiclayout/tutorial/__init__.py
- :lines: 14
+ :lines: 15
:lineno-match:
:language: py
@@ -65,35 +65,28 @@ See also :term:`Deployment settings`.
This will be a dictionary of settings parsed from the ``.ini`` file, which contains
deployment-related values, such as ``pyramid.reload_templates``, ``zodbconn.uri``, and so on.
-Next include support for ``pyramid_tm``, allowing Pyramid requests to join the active transaction as provided by the `transaction <https://pypi.org/project/transaction/>`_ package.
-
-.. literalinclude:: src/basiclayout/tutorial/__init__.py
- :lines: 15
- :lineno-match:
- :language: py
-
-Next include support for ``pyramid_retry`` to retry a request when transient exceptions occur.
+Next include support for the :term:`Chameleon` template rendering bindings, allowing us to use the ``.pt`` templates.
.. literalinclude:: src/basiclayout/tutorial/__init__.py
:lines: 16
:lineno-match:
:language: py
-Next include support for ``pyramid_zodbconn``, providing integration between :term:`ZODB` and a Pyramid application.
+Next include support for ``pyramid_tm``, allowing Pyramid requests to join the active transaction as provided by the `transaction <https://pypi.org/project/transaction/>`_ package.
.. literalinclude:: src/basiclayout/tutorial/__init__.py
:lines: 17
:lineno-match:
:language: py
-Next set a root factory using our function named ``root_factory``.
+Next include support for ``pyramid_retry`` to retry a request when transient exceptions occur.
.. literalinclude:: src/basiclayout/tutorial/__init__.py
:lines: 18
:lineno-match:
:language: py
-Next include support for the :term:`Chameleon` template rendering bindings, allowing us to use the ``.pt`` templates.
+Next include support for ``pyramid_zodbconn``, providing integration between :term:`ZODB` and a Pyramid application.
.. literalinclude:: src/basiclayout/tutorial/__init__.py
:lines: 19
@@ -107,6 +100,13 @@ Next include routes from the ``.routes`` module.
:lineno-match:
:language: py
+Next set a root factory using our function named ``root_factory``.
+
+.. literalinclude:: src/basiclayout/tutorial/__init__.py
+ :lines: 21
+ :lineno-match:
+ :language: py
+
The included module contains the following function.
.. literalinclude:: src/basiclayout/tutorial/routes.py
@@ -130,7 +130,7 @@ The third argument is an optional ``cache_max_age`` which specifies the number o
Back into our ``__init__.py``, next perform a :term:`scan`.
.. literalinclude:: src/basiclayout/tutorial/__init__.py
- :lines: 21
+ :lines: 22
:lineno-match:
:language: py
@@ -142,7 +142,7 @@ The cookiecutter could have equivalently said ``config.scan('tutorial')``, but i
Finally use the :meth:`pyramid.config.Configurator.make_wsgi_app` method to return a :term:`WSGI` application.
.. literalinclude:: src/basiclayout/tutorial/__init__.py
- :lines: 22
+ :lines: 23
:lineno-match:
:language: py
@@ -262,3 +262,10 @@ The ``development.ini`` (in the ``tutorial`` :term:`project` directory, as oppos
Note the existence of a ``[app:main]`` section which specifies our WSGI application.
Our ZODB database settings are specified as the ``zodbconn.uri`` setting within this section.
When the server is started via ``pserve``, the values within this section are passed as ``**settings`` to the ``main`` function defined in ``__init__.py``.
+
+
+Tests
+-----
+
+The project contains a basic structure for a test suite using ``pytest``.
+The structure is covered later in :ref:`wiki_adding_tests`.