summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSteve Piercy <web@stevepiercy.com>2017-06-10 23:45:31 -0700
committerSteve Piercy <web@stevepiercy.com>2017-06-10 23:45:31 -0700
commit65a6d3a79f8fdcdd32a70888c669a8548366f7cb (patch)
treecfa12a0588f36a76a8c83d6401110a2a34c6d919 /docs
parentbb079f4094da8e2dce39e4020f6126b9df533728 (diff)
downloadpyramid-65a6d3a79f8fdcdd32a70888c669a8548366f7cb.tar.gz
pyramid-65a6d3a79f8fdcdd32a70888c669a8548366f7cb.tar.bz2
pyramid-65a6d3a79f8fdcdd32a70888c669a8548366f7cb.zip
update src files and synch emphasize-lines for quick_tour
Diffstat (limited to 'docs')
-rw-r--r--docs/quick_tour.rst20
-rw-r--r--docs/quick_tour/logging/setup.py1
-rw-r--r--docs/quick_tour/package/setup.py1
-rw-r--r--docs/quick_tour/sessions/setup.py1
-rw-r--r--docs/quick_tour/sqla_demo/development.ini2
-rw-r--r--docs/quick_tour/sqla_demo/production.ini2
-rw-r--r--docs/quick_tour/sqla_demo/setup.py6
-rw-r--r--docs/quick_tour/sqla_demo/sqla_demo/models/__init__.py4
8 files changed, 21 insertions, 16 deletions
diff --git a/docs/quick_tour.rst b/docs/quick_tour.rst
index f3a0a27b8..5679b0dc8 100644
--- a/docs/quick_tour.rst
+++ b/docs/quick_tour.rst
@@ -647,8 +647,8 @@ add-on ``pyramid_debugtoolbar`` in its ``setup.py``:
.. literalinclude:: quick_tour/package/setup.py
:language: python
:lineno-match:
- :lines: 11-16
- :emphasize-lines: 4
+ :lines: 11-17
+ :emphasize-lines: 5
It was installed when you previously ran:
@@ -657,14 +657,7 @@ It was installed when you previously ran:
$ $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 ``__init__.py``:
-
-.. literalinclude:: quick_tour/package/hello_world/__init__.py
- :language: python
- :lineno-match:
- :lines: 8
-
-And it uses the ``pyramid.includes`` facility in our ``development.ini``:
+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:
.. literalinclude:: quick_tour/package/development.ini
:language: ini
@@ -692,18 +685,17 @@ before its release.
Our ``pyramid-cookiecutter-starter`` cookiecutter generated a ``tests.py`` module with
one unit test and one functional test in it. It also configured ``setup.py`` with test requirements:
``py.test`` as the test runner, ``WebTest`` for running view tests, and the
-``pytest-cov`` tool which yells at us for code that isn't tested. The
-highlighted lines show this:
+``pytest-cov`` tool which yells at us for code that isn't tested:
.. literalinclude:: quick_tour/package/setup.py
:language: python
:lineno-match:
- :lines: 18-22
+ :lines: 19-23
.. literalinclude:: quick_tour/package/setup.py
:language: python
:lineno-match:
- :lines: 42-44
+ :lines: 43-45
We already installed the test requirements when we ran the command ``$VENV/bin/pip install -e ".[testing]"``. We can now run all our tests:
diff --git a/docs/quick_tour/logging/setup.py b/docs/quick_tour/logging/setup.py
index e32aecacd..44d90b990 100644
--- a/docs/quick_tour/logging/setup.py
+++ b/docs/quick_tour/logging/setup.py
@@ -9,6 +9,7 @@ with open(os.path.join(here, 'CHANGES.txt')) as f:
CHANGES = f.read()
requires = [
+ 'plaster_pastedeploy',
'pyramid',
'pyramid_jinja2',
'pyramid_debugtoolbar',
diff --git a/docs/quick_tour/package/setup.py b/docs/quick_tour/package/setup.py
index e32aecacd..44d90b990 100644
--- a/docs/quick_tour/package/setup.py
+++ b/docs/quick_tour/package/setup.py
@@ -9,6 +9,7 @@ with open(os.path.join(here, 'CHANGES.txt')) as f:
CHANGES = f.read()
requires = [
+ 'plaster_pastedeploy',
'pyramid',
'pyramid_jinja2',
'pyramid_debugtoolbar',
diff --git a/docs/quick_tour/sessions/setup.py b/docs/quick_tour/sessions/setup.py
index e32aecacd..44d90b990 100644
--- a/docs/quick_tour/sessions/setup.py
+++ b/docs/quick_tour/sessions/setup.py
@@ -9,6 +9,7 @@ with open(os.path.join(here, 'CHANGES.txt')) as f:
CHANGES = f.read()
requires = [
+ 'plaster_pastedeploy',
'pyramid',
'pyramid_jinja2',
'pyramid_debugtoolbar',
diff --git a/docs/quick_tour/sqla_demo/development.ini b/docs/quick_tour/sqla_demo/development.ini
index 8d45a0975..a986c0063 100644
--- a/docs/quick_tour/sqla_demo/development.ini
+++ b/docs/quick_tour/sqla_demo/development.ini
@@ -16,6 +16,8 @@ pyramid.includes =
sqlalchemy.url = sqlite:///%(here)s/sqla_demo.sqlite
+retry.attempts = 3
+
# By default, the toolbar only appears for clients from IP addresses
# '127.0.0.1' and '::1'.
# debugtoolbar.hosts = 127.0.0.1 ::1
diff --git a/docs/quick_tour/sqla_demo/production.ini b/docs/quick_tour/sqla_demo/production.ini
index a85c354d3..9abb54231 100644
--- a/docs/quick_tour/sqla_demo/production.ini
+++ b/docs/quick_tour/sqla_demo/production.ini
@@ -14,6 +14,8 @@ pyramid.default_locale_name = en
sqlalchemy.url = sqlite:///%(here)s/sqla_demo.sqlite
+retry.attempts = 3
+
###
# wsgi server configuration
###
diff --git a/docs/quick_tour/sqla_demo/setup.py b/docs/quick_tour/sqla_demo/setup.py
index 75c1403fb..855a15d58 100644
--- a/docs/quick_tour/sqla_demo/setup.py
+++ b/docs/quick_tour/sqla_demo/setup.py
@@ -9,9 +9,11 @@ with open(os.path.join(here, 'CHANGES.txt')) as f:
CHANGES = f.read()
requires = [
- 'pyramid',
- 'pyramid_jinja2',
+ 'plaster_pastedeploy',
+ 'pyramid >= 1.9a',
'pyramid_debugtoolbar',
+ 'pyramid_jinja2',
+ 'pyramid_retry',
'pyramid_tm',
'SQLAlchemy',
'transaction',
diff --git a/docs/quick_tour/sqla_demo/sqla_demo/models/__init__.py b/docs/quick_tour/sqla_demo/sqla_demo/models/__init__.py
index e6eb98fbd..31aab9d26 100644
--- a/docs/quick_tour/sqla_demo/sqla_demo/models/__init__.py
+++ b/docs/quick_tour/sqla_demo/sqla_demo/models/__init__.py
@@ -58,9 +58,13 @@ def includeme(config):
"""
settings = config.get_settings()
settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager'
+
# use pyramid_tm to hook the transaction lifecycle to the request
config.include('pyramid_tm')
+ # use pyramid_retry to retry a request when transient exceptions occur
+ config.include('pyramid_retry')
+
session_factory = get_session_factory(get_engine(settings))
config.registry['dbsession_factory'] = session_factory