From 6d120e5f740f3b9a3f9ffd52da5c748b2f06cbca Mon Sep 17 00:00:00 2001 From: Aleph Melo Date: Sun, 16 Apr 2017 16:50:45 -0300 Subject: Fix #2927 - Change to listen = localhost:6543. --- docs/quick_tour/logging/development.ini | 2 +- docs/quick_tour/package/development.ini | 2 +- docs/quick_tour/sessions/development.ini | 2 +- docs/quick_tour/sqla_demo/development.ini | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/quick_tour') diff --git a/docs/quick_tour/logging/development.ini b/docs/quick_tour/logging/development.ini index 1f19e373d..b0210cbad 100644 --- a/docs/quick_tour/logging/development.ini +++ b/docs/quick_tour/logging/development.ini @@ -24,7 +24,7 @@ pyramid.includes = [server:main] use = egg:waitress#main -listen = 127.0.0.1:6543 [::1]:6543 +listen = localhost:6543 ### # logging configuration diff --git a/docs/quick_tour/package/development.ini b/docs/quick_tour/package/development.ini index 1f19e373d..b0210cbad 100644 --- a/docs/quick_tour/package/development.ini +++ b/docs/quick_tour/package/development.ini @@ -24,7 +24,7 @@ pyramid.includes = [server:main] use = egg:waitress#main -listen = 127.0.0.1:6543 [::1]:6543 +listen = localhost:6543 ### # logging configuration diff --git a/docs/quick_tour/sessions/development.ini b/docs/quick_tour/sessions/development.ini index 1f19e373d..b0210cbad 100644 --- a/docs/quick_tour/sessions/development.ini +++ b/docs/quick_tour/sessions/development.ini @@ -24,7 +24,7 @@ pyramid.includes = [server:main] use = egg:waitress#main -listen = 127.0.0.1:6543 [::1]:6543 +listen = localhost:6543 ### # logging configuration diff --git a/docs/quick_tour/sqla_demo/development.ini b/docs/quick_tour/sqla_demo/development.ini index 17b57fd0d..8d45a0975 100644 --- a/docs/quick_tour/sqla_demo/development.ini +++ b/docs/quick_tour/sqla_demo/development.ini @@ -26,7 +26,7 @@ sqlalchemy.url = sqlite:///%(here)s/sqla_demo.sqlite [server:main] use = egg:waitress#main -listen = 127.0.0.1:6543 [::1]:6543 +listen = localhost:6543 ### # logging configuration -- cgit v1.2.3 From 68f673ff520c4bdffac796c9965936ec57916c72 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 28 Apr 2017 00:09:20 -0700 Subject: update cookiecutter README.txt throughout docs - https://github.com/Pylons/pyramid-cookiecutter-starter/pull/28 - https://github.com/Pylons/pyramid-cookiecutter-zodb/pull/7 - https://github.com/Pylons/pyramid-cookiecutter-alchemy/pull/8 --- docs/quick_tour/logging/README.txt | 2 +- docs/quick_tour/package/README.txt | 2 +- docs/quick_tour/sessions/README.txt | 2 +- docs/quick_tour/sqla_demo/README.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/quick_tour') diff --git a/docs/quick_tour/logging/README.txt b/docs/quick_tour/logging/README.txt index fb7bde0a7..ff70a1354 100644 --- a/docs/quick_tour/logging/README.txt +++ b/docs/quick_tour/logging/README.txt @@ -1,5 +1,5 @@ hello_world -=============================== +=========== Getting Started --------------- diff --git a/docs/quick_tour/package/README.txt b/docs/quick_tour/package/README.txt index fb7bde0a7..ff70a1354 100644 --- a/docs/quick_tour/package/README.txt +++ b/docs/quick_tour/package/README.txt @@ -1,5 +1,5 @@ hello_world -=============================== +=========== Getting Started --------------- diff --git a/docs/quick_tour/sessions/README.txt b/docs/quick_tour/sessions/README.txt index fb7bde0a7..ff70a1354 100644 --- a/docs/quick_tour/sessions/README.txt +++ b/docs/quick_tour/sessions/README.txt @@ -1,5 +1,5 @@ hello_world -=============================== +=========== Getting Started --------------- diff --git a/docs/quick_tour/sqla_demo/README.txt b/docs/quick_tour/sqla_demo/README.txt index 1659e47ab..27bbff5a7 100644 --- a/docs/quick_tour/sqla_demo/README.txt +++ b/docs/quick_tour/sqla_demo/README.txt @@ -1,5 +1,5 @@ sqla_demo -=============================== +========= Getting Started --------------- -- cgit v1.2.3 From c5538ea907990a19994c9d9acda92e602a8769c4 Mon Sep 17 00:00:00 2001 From: Fang-Pen Lin Date: Mon, 22 May 2017 16:54:17 -0700 Subject: Also replace script tags appear everywhere --- docs/quick_tour/logging/hello_world/templates/layout.jinja2 | 8 ++++---- docs/quick_tour/package/hello_world/templates/layout.jinja2 | 8 ++++---- docs/quick_tour/sessions/hello_world/templates/layout.jinja2 | 8 ++++---- docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'docs/quick_tour') diff --git a/docs/quick_tour/logging/hello_world/templates/layout.jinja2 b/docs/quick_tour/logging/hello_world/templates/layout.jinja2 index 916127267..c82cac915 100644 --- a/docs/quick_tour/logging/hello_world/templates/layout.jinja2 +++ b/docs/quick_tour/logging/hello_world/templates/layout.jinja2 @@ -18,8 +18,8 @@ @@ -58,7 +58,7 @@ - - + + diff --git a/docs/quick_tour/package/hello_world/templates/layout.jinja2 b/docs/quick_tour/package/hello_world/templates/layout.jinja2 index 916127267..c82cac915 100644 --- a/docs/quick_tour/package/hello_world/templates/layout.jinja2 +++ b/docs/quick_tour/package/hello_world/templates/layout.jinja2 @@ -18,8 +18,8 @@ @@ -58,7 +58,7 @@ - - + + diff --git a/docs/quick_tour/sessions/hello_world/templates/layout.jinja2 b/docs/quick_tour/sessions/hello_world/templates/layout.jinja2 index 916127267..c82cac915 100644 --- a/docs/quick_tour/sessions/hello_world/templates/layout.jinja2 +++ b/docs/quick_tour/sessions/hello_world/templates/layout.jinja2 @@ -18,8 +18,8 @@ @@ -58,7 +58,7 @@ - - + + diff --git a/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 b/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 index 4607eb11f..b84b3ec0e 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 +++ b/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 @@ -18,8 +18,8 @@ @@ -58,7 +58,7 @@ - - + + -- cgit v1.2.3 From d8388838022aa5bafe78c8ba6949bc52c2968799 Mon Sep 17 00:00:00 2001 From: Chris Morales Date: Tue, 23 May 2017 15:01:16 -0700 Subject: updated references for the models that have references for the config.settings --- docs/quick_tour/sqla_demo/sqla_demo/models/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tour') 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 339326758..e6eb98fbd 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/models/__init__.py +++ b/docs/quick_tour/sqla_demo/sqla_demo/models/__init__.py @@ -57,7 +57,7 @@ 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') -- cgit v1.2.3 From 65a6d3a79f8fdcdd32a70888c669a8548366f7cb Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 10 Jun 2017 23:45:31 -0700 Subject: update src files and synch emphasize-lines for quick_tour --- docs/quick_tour/logging/setup.py | 1 + docs/quick_tour/package/setup.py | 1 + docs/quick_tour/sessions/setup.py | 1 + docs/quick_tour/sqla_demo/development.ini | 2 ++ docs/quick_tour/sqla_demo/production.ini | 2 ++ docs/quick_tour/sqla_demo/setup.py | 6 ++++-- docs/quick_tour/sqla_demo/sqla_demo/models/__init__.py | 4 ++++ 7 files changed, 15 insertions(+), 2 deletions(-) (limited to 'docs/quick_tour') 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 -- cgit v1.2.3 From 2cd6a6dbcdb517788ef3275af63feca703e73658 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Thu, 15 Jun 2017 21:59:18 -0700 Subject: Use HTTPS for pylonsproject.org --- docs/quick_tour/logging/hello_world/templates/layout.jinja2 | 2 +- docs/quick_tour/package/hello_world/templates/layout.jinja2 | 2 +- docs/quick_tour/sessions/hello_world/templates/layout.jinja2 | 2 +- docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/quick_tour') diff --git a/docs/quick_tour/logging/hello_world/templates/layout.jinja2 b/docs/quick_tour/logging/hello_world/templates/layout.jinja2 index c82cac915..8473e8b5d 100644 --- a/docs/quick_tour/logging/hello_world/templates/layout.jinja2 +++ b/docs/quick_tour/logging/hello_world/templates/layout.jinja2 @@ -42,7 +42,7 @@ diff --git a/docs/quick_tour/package/hello_world/templates/layout.jinja2 b/docs/quick_tour/package/hello_world/templates/layout.jinja2 index c82cac915..8473e8b5d 100644 --- a/docs/quick_tour/package/hello_world/templates/layout.jinja2 +++ b/docs/quick_tour/package/hello_world/templates/layout.jinja2 @@ -42,7 +42,7 @@ diff --git a/docs/quick_tour/sessions/hello_world/templates/layout.jinja2 b/docs/quick_tour/sessions/hello_world/templates/layout.jinja2 index c82cac915..8473e8b5d 100644 --- a/docs/quick_tour/sessions/hello_world/templates/layout.jinja2 +++ b/docs/quick_tour/sessions/hello_world/templates/layout.jinja2 @@ -42,7 +42,7 @@ diff --git a/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 b/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 index b84b3ec0e..69c9941ac 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 +++ b/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 @@ -42,7 +42,7 @@ -- cgit v1.2.3 From 80ce00e7a408fc295d9eb1ffef3cdc6073a01b5e Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Thu, 15 Jun 2017 22:04:05 -0700 Subject: remove trailing slash --- docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tour') diff --git a/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 b/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 index 69c9941ac..03f07524a 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 +++ b/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 @@ -42,7 +42,7 @@ -- cgit v1.2.3 From 19d341b5be789e97000d3dcbd33de75d8b061829 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 26 Jun 2017 03:48:21 -0700 Subject: change http://docs.pylonsproject.org to https - use correct URL for code style - use correct Pyramid version for zodb wiki src file template --- docs/quick_tour/logging/development.ini | 4 ++-- docs/quick_tour/logging/production.ini | 4 ++-- docs/quick_tour/package/development.ini | 4 ++-- docs/quick_tour/package/production.ini | 4 ++-- docs/quick_tour/sessions/development.ini | 4 ++-- docs/quick_tour/sessions/production.ini | 4 ++-- docs/quick_tour/sqla_demo/development.ini | 4 ++-- docs/quick_tour/sqla_demo/production.ini | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) (limited to 'docs/quick_tour') diff --git a/docs/quick_tour/logging/development.ini b/docs/quick_tour/logging/development.ini index b0210cbad..5e7317fc7 100644 --- a/docs/quick_tour/logging/development.ini +++ b/docs/quick_tour/logging/development.ini @@ -1,6 +1,6 @@ ### # app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html ### [app:main] @@ -28,7 +28,7 @@ listen = localhost:6543 ### # logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html ### [loggers] diff --git a/docs/quick_tour/logging/production.ini b/docs/quick_tour/logging/production.ini index 9c12bc4ec..3eedddda1 100644 --- a/docs/quick_tour/logging/production.ini +++ b/docs/quick_tour/logging/production.ini @@ -1,6 +1,6 @@ ### # app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html ### [app:main] @@ -22,7 +22,7 @@ listen = *:6543 ### # logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html ### [loggers] diff --git a/docs/quick_tour/package/development.ini b/docs/quick_tour/package/development.ini index b0210cbad..5e7317fc7 100644 --- a/docs/quick_tour/package/development.ini +++ b/docs/quick_tour/package/development.ini @@ -1,6 +1,6 @@ ### # app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html ### [app:main] @@ -28,7 +28,7 @@ listen = localhost:6543 ### # logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html ### [loggers] diff --git a/docs/quick_tour/package/production.ini b/docs/quick_tour/package/production.ini index 9c12bc4ec..3eedddda1 100644 --- a/docs/quick_tour/package/production.ini +++ b/docs/quick_tour/package/production.ini @@ -1,6 +1,6 @@ ### # app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html ### [app:main] @@ -22,7 +22,7 @@ listen = *:6543 ### # logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html ### [loggers] diff --git a/docs/quick_tour/sessions/development.ini b/docs/quick_tour/sessions/development.ini index b0210cbad..5e7317fc7 100644 --- a/docs/quick_tour/sessions/development.ini +++ b/docs/quick_tour/sessions/development.ini @@ -1,6 +1,6 @@ ### # app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html ### [app:main] @@ -28,7 +28,7 @@ listen = localhost:6543 ### # logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html ### [loggers] diff --git a/docs/quick_tour/sessions/production.ini b/docs/quick_tour/sessions/production.ini index 9c12bc4ec..3eedddda1 100644 --- a/docs/quick_tour/sessions/production.ini +++ b/docs/quick_tour/sessions/production.ini @@ -1,6 +1,6 @@ ### # app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html ### [app:main] @@ -22,7 +22,7 @@ listen = *:6543 ### # logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html ### [loggers] diff --git a/docs/quick_tour/sqla_demo/development.ini b/docs/quick_tour/sqla_demo/development.ini index a986c0063..8836a846e 100644 --- a/docs/quick_tour/sqla_demo/development.ini +++ b/docs/quick_tour/sqla_demo/development.ini @@ -1,6 +1,6 @@ ### # app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html ### [app:main] @@ -32,7 +32,7 @@ listen = localhost:6543 ### # logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html ### [loggers] diff --git a/docs/quick_tour/sqla_demo/production.ini b/docs/quick_tour/sqla_demo/production.ini index 9abb54231..4566e02a0 100644 --- a/docs/quick_tour/sqla_demo/production.ini +++ b/docs/quick_tour/sqla_demo/production.ini @@ -1,6 +1,6 @@ ### # app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html ### [app:main] @@ -26,7 +26,7 @@ listen = *:6543 ### # logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html ### [loggers] -- cgit v1.2.3 From e33212c6746cbf50c4952b5d8c8d93714cf06ccd Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 3 Jul 2017 21:06:56 -0700 Subject: Update example apps to use config context manager in Quick Tour - add missing EOF line ending --- docs/quick_tour/hello_world/app.py | 8 ++++---- docs/quick_tour/jinja2/app.py | 10 +++++----- docs/quick_tour/json/app.py | 14 +++++++------- docs/quick_tour/requests/app.py | 8 ++++---- docs/quick_tour/routing/app.py | 10 +++++----- docs/quick_tour/static_assets/app.py | 12 ++++++------ docs/quick_tour/templating/app.py | 10 +++++----- docs/quick_tour/view_classes/app.py | 14 +++++++------- docs/quick_tour/views/app.py | 14 +++++++------- 9 files changed, 50 insertions(+), 50 deletions(-) (limited to 'docs/quick_tour') diff --git a/docs/quick_tour/hello_world/app.py b/docs/quick_tour/hello_world/app.py index 75d22ac96..dc6f32310 100644 --- a/docs/quick_tour/hello_world/app.py +++ b/docs/quick_tour/hello_world/app.py @@ -8,9 +8,9 @@ def hello_world(request): if __name__ == '__main__': - config = Configurator() - config.add_route('hello', '/') - config.add_view(hello_world, route_name='hello') - app = config.make_wsgi_app() + with Configurator() as config: + config.add_route('hello', '/') + config.add_view(hello_world, route_name='hello') + app = config.make_wsgi_app() server = make_server('0.0.0.0', 6543, app) server.serve_forever() diff --git a/docs/quick_tour/jinja2/app.py b/docs/quick_tour/jinja2/app.py index b7632807b..2683e0451 100644 --- a/docs/quick_tour/jinja2/app.py +++ b/docs/quick_tour/jinja2/app.py @@ -2,10 +2,10 @@ from wsgiref.simple_server import make_server from pyramid.config import Configurator if __name__ == '__main__': - config = Configurator() - config.add_route('hello', '/howdy/{name}') - config.include('pyramid_jinja2') - config.scan('views') - app = config.make_wsgi_app() + with Configurator() as config: + config.add_route('hello', '/howdy/{name}') + config.include('pyramid_jinja2') + config.scan('views') + app = config.make_wsgi_app() server = make_server('0.0.0.0', 6543, app) server.serve_forever() diff --git a/docs/quick_tour/json/app.py b/docs/quick_tour/json/app.py index 40faddd00..a007dee14 100644 --- a/docs/quick_tour/json/app.py +++ b/docs/quick_tour/json/app.py @@ -2,12 +2,12 @@ from wsgiref.simple_server import make_server from pyramid.config import Configurator if __name__ == '__main__': - config = Configurator() - config.add_route('hello', '/howdy/{name}') - config.add_route('hello_json', 'hello.json') - config.add_static_view(name='static', path='static') - config.include('pyramid_jinja2') - config.scan('views') - app = config.make_wsgi_app() + with Configurator() as config: + config.add_route('hello', '/howdy/{name}') + config.add_route('hello_json', 'hello.json') + config.add_static_view(name='static', path='static') + config.include('pyramid_jinja2') + config.scan('views') + app = config.make_wsgi_app() server = make_server('0.0.0.0', 6543, app) server.serve_forever() diff --git a/docs/quick_tour/requests/app.py b/docs/quick_tour/requests/app.py index f55264cff..58e8823cc 100644 --- a/docs/quick_tour/requests/app.py +++ b/docs/quick_tour/requests/app.py @@ -16,9 +16,9 @@ def hello_world(request): if __name__ == '__main__': - config = Configurator() - config.add_route('hello', '/') - config.add_view(hello_world, route_name='hello') - app = config.make_wsgi_app() + with Configurator() as config: + config.add_route('hello', '/') + config.add_view(hello_world, route_name='hello') + app = config.make_wsgi_app() server = make_server('0.0.0.0', 6543, app) server.serve_forever() diff --git a/docs/quick_tour/routing/app.py b/docs/quick_tour/routing/app.py index 12b547bfe..75c18b7d1 100644 --- a/docs/quick_tour/routing/app.py +++ b/docs/quick_tour/routing/app.py @@ -2,9 +2,9 @@ from wsgiref.simple_server import make_server from pyramid.config import Configurator if __name__ == '__main__': - config = Configurator() - config.add_route('hello', '/howdy/{first}/{last}') - config.scan('views') - app = config.make_wsgi_app() + with Configurator() as config: + config.add_route('hello', '/howdy/{first}/{last}') + config.scan('views') + app = config.make_wsgi_app() server = make_server('0.0.0.0', 6543, app) - server.serve_forever() \ No newline at end of file + server.serve_forever() diff --git a/docs/quick_tour/static_assets/app.py b/docs/quick_tour/static_assets/app.py index 1849c0a5a..c31fc797c 100644 --- a/docs/quick_tour/static_assets/app.py +++ b/docs/quick_tour/static_assets/app.py @@ -2,11 +2,11 @@ from wsgiref.simple_server import make_server from pyramid.config import Configurator if __name__ == '__main__': - config = Configurator() - config.add_route('hello', '/howdy/{name}') - config.add_static_view(name='static', path='static') - config.include('pyramid_jinja2') - config.scan('views') - app = config.make_wsgi_app() + with Configurator() as config: + config.add_route('hello', '/howdy/{name}') + config.add_static_view(name='static', path='static') + config.include('pyramid_jinja2') + config.scan('views') + app = config.make_wsgi_app() server = make_server('0.0.0.0', 6543, app) server.serve_forever() diff --git a/docs/quick_tour/templating/app.py b/docs/quick_tour/templating/app.py index 52b7faf55..8db99df91 100644 --- a/docs/quick_tour/templating/app.py +++ b/docs/quick_tour/templating/app.py @@ -2,10 +2,10 @@ from wsgiref.simple_server import make_server from pyramid.config import Configurator if __name__ == '__main__': - config = Configurator() - config.add_route('hello', '/howdy/{name}') - config.include('pyramid_chameleon') - config.scan('views') - app = config.make_wsgi_app() + with Configurator() as config: + config.add_route('hello', '/howdy/{name}') + config.include('pyramid_chameleon') + config.scan('views') + app = config.make_wsgi_app() server = make_server('0.0.0.0', 6543, app) server.serve_forever() diff --git a/docs/quick_tour/view_classes/app.py b/docs/quick_tour/view_classes/app.py index 40faddd00..a007dee14 100644 --- a/docs/quick_tour/view_classes/app.py +++ b/docs/quick_tour/view_classes/app.py @@ -2,12 +2,12 @@ from wsgiref.simple_server import make_server from pyramid.config import Configurator if __name__ == '__main__': - config = Configurator() - config.add_route('hello', '/howdy/{name}') - config.add_route('hello_json', 'hello.json') - config.add_static_view(name='static', path='static') - config.include('pyramid_jinja2') - config.scan('views') - app = config.make_wsgi_app() + with Configurator() as config: + config.add_route('hello', '/howdy/{name}') + config.add_route('hello_json', 'hello.json') + config.add_static_view(name='static', path='static') + config.include('pyramid_jinja2') + config.scan('views') + app = config.make_wsgi_app() server = make_server('0.0.0.0', 6543, app) server.serve_forever() diff --git a/docs/quick_tour/views/app.py b/docs/quick_tour/views/app.py index e8df6eff2..12d9d25b5 100644 --- a/docs/quick_tour/views/app.py +++ b/docs/quick_tour/views/app.py @@ -2,12 +2,12 @@ from wsgiref.simple_server import make_server from pyramid.config import Configurator if __name__ == '__main__': - config = Configurator() - config.add_route('home', '/') - config.add_route('hello', '/howdy') - config.add_route('redirect', '/goto') - config.add_route('exception', '/problem') - config.scan('views') - app = config.make_wsgi_app() + with Configurator() as config: + config.add_route('home', '/') + config.add_route('hello', '/howdy') + config.add_route('redirect', '/goto') + config.add_route('exception', '/problem') + config.scan('views') + app = config.make_wsgi_app() server = make_server('0.0.0.0', 6543, app) server.serve_forever() -- cgit v1.2.3 From cae6da810e5b0571a8e5f46da619fa7761ee62b9 Mon Sep 17 00:00:00 2001 From: Jeremy Chen Date: Wed, 30 Aug 2017 22:35:18 +1000 Subject: change cgi.escape to pyramid compat.escape --- docs/quick_tour/views/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/quick_tour') diff --git a/docs/quick_tour/views/views.py b/docs/quick_tour/views/views.py index 1449cbb38..9db8ef3c4 100644 --- a/docs/quick_tour/views/views.py +++ b/docs/quick_tour/views/views.py @@ -1,4 +1,4 @@ -import cgi +from pyramid.compat import escape from pyramid.httpexceptions import HTTPFound from pyramid.response import Response @@ -17,7 +17,7 @@ def hello_view(request): name = request.params.get('name', 'No Name') body = '

Hi %s, this redirects

' # cgi.escape to prevent Cross-Site Scripting (XSS) [CWE 79] - return Response(body % cgi.escape(name)) + return Response(body % escape(name)) # /goto which issues HTTP redirect to the last view -- cgit v1.2.3 From f67d8c770687d5ee82cc21e608c2daf5dbfd50f7 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 22 Sep 2017 23:46:59 -0700 Subject: update comment to align with method --- docs/quick_tour/views/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tour') diff --git a/docs/quick_tour/views/views.py b/docs/quick_tour/views/views.py index 9db8ef3c4..95a2b60ca 100644 --- a/docs/quick_tour/views/views.py +++ b/docs/quick_tour/views/views.py @@ -16,7 +16,7 @@ def home_view(request): def hello_view(request): name = request.params.get('name', 'No Name') body = '

Hi %s, this redirects

' - # cgi.escape to prevent Cross-Site Scripting (XSS) [CWE 79] + # pyramid.compat.escape to prevent Cross-Site Scripting (XSS) [CWE 79] return Response(body % escape(name)) -- cgit v1.2.3 From f9ae5ad563d74aced30b035798ecebdab70b3134 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 28 Oct 2017 09:46:52 -0700 Subject: Synch source files with cookiecutter --- docs/quick_tour/sqla_demo/sqla_demo/models/meta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tour') diff --git a/docs/quick_tour/sqla_demo/sqla_demo/models/meta.py b/docs/quick_tour/sqla_demo/sqla_demo/models/meta.py index 0682247b5..02285b3ff 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/models/meta.py +++ b/docs/quick_tour/sqla_demo/sqla_demo/models/meta.py @@ -5,7 +5,7 @@ from sqlalchemy.schema import MetaData # providers will autogenerate vastly different names making migrations more # difficult. See: http://alembic.zzzcomputing.com/en/latest/naming.html NAMING_CONVENTION = { - "ix": 'ix_%(column_0_label)s', + "ix": "ix_%(column_0_label)s", "uq": "uq_%(table_name)s_%(column_0_name)s", "ck": "ck_%(table_name)s_%(constraint_name)s", "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s", -- cgit v1.2.3 From 1c608c51d6539218b031cf2b043b4574e5a4dbee Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 12 Jan 2018 00:49:23 -0800 Subject: Update templates to align with cookiecutters - Update CDN assets to minor versions - Use data attribute for Jinja2 templates (already done in mako and chameleon) --- docs/quick_tour/logging/hello_world/templates/layout.jinja2 | 8 ++++---- docs/quick_tour/logging/hello_world/templates/mytemplate.jinja2 | 2 +- docs/quick_tour/package/hello_world/templates/layout.jinja2 | 8 ++++---- docs/quick_tour/package/hello_world/templates/mytemplate.jinja2 | 2 +- docs/quick_tour/sessions/hello_world/templates/layout.jinja2 | 8 ++++---- docs/quick_tour/sessions/hello_world/templates/mytemplate.jinja2 | 2 +- docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 | 8 ++++---- docs/quick_tour/sqla_demo/sqla_demo/templates/mytemplate.jinja2 | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) (limited to 'docs/quick_tour') diff --git a/docs/quick_tour/logging/hello_world/templates/layout.jinja2 b/docs/quick_tour/logging/hello_world/templates/layout.jinja2 index 8473e8b5d..64142f819 100644 --- a/docs/quick_tour/logging/hello_world/templates/layout.jinja2 +++ b/docs/quick_tour/logging/hello_world/templates/layout.jinja2 @@ -11,7 +11,7 @@ Cookiecutter Starter project for the Pyramid Web Framework - + @@ -19,7 +19,7 @@ @@ -58,7 +58,7 @@ - - + + diff --git a/docs/quick_tour/logging/hello_world/templates/mytemplate.jinja2 b/docs/quick_tour/logging/hello_world/templates/mytemplate.jinja2 index cf2d7f996..f2e7283f8 100644 --- a/docs/quick_tour/logging/hello_world/templates/mytemplate.jinja2 +++ b/docs/quick_tour/logging/hello_world/templates/mytemplate.jinja2 @@ -3,6 +3,6 @@ {% block content %}

Pyramid Starter project

-

Welcome to hello_world, a Pyramid application generated by
Cookiecutter.

+

Welcome to {{project}}, a Pyramid application generated by
Cookiecutter.

{% endblock content %} diff --git a/docs/quick_tour/package/hello_world/templates/layout.jinja2 b/docs/quick_tour/package/hello_world/templates/layout.jinja2 index 8473e8b5d..64142f819 100644 --- a/docs/quick_tour/package/hello_world/templates/layout.jinja2 +++ b/docs/quick_tour/package/hello_world/templates/layout.jinja2 @@ -11,7 +11,7 @@ Cookiecutter Starter project for the Pyramid Web Framework - + @@ -19,7 +19,7 @@ @@ -58,7 +58,7 @@ - - + + diff --git a/docs/quick_tour/package/hello_world/templates/mytemplate.jinja2 b/docs/quick_tour/package/hello_world/templates/mytemplate.jinja2 index cf2d7f996..f2e7283f8 100644 --- a/docs/quick_tour/package/hello_world/templates/mytemplate.jinja2 +++ b/docs/quick_tour/package/hello_world/templates/mytemplate.jinja2 @@ -3,6 +3,6 @@ {% block content %}

Pyramid Starter project

-

Welcome to hello_world, a Pyramid application generated by
Cookiecutter.

+

Welcome to {{project}}, a Pyramid application generated by
Cookiecutter.

{% endblock content %} diff --git a/docs/quick_tour/sessions/hello_world/templates/layout.jinja2 b/docs/quick_tour/sessions/hello_world/templates/layout.jinja2 index 8473e8b5d..64142f819 100644 --- a/docs/quick_tour/sessions/hello_world/templates/layout.jinja2 +++ b/docs/quick_tour/sessions/hello_world/templates/layout.jinja2 @@ -11,7 +11,7 @@ Cookiecutter Starter project for the Pyramid Web Framework - + @@ -19,7 +19,7 @@ @@ -58,7 +58,7 @@ - - + + diff --git a/docs/quick_tour/sessions/hello_world/templates/mytemplate.jinja2 b/docs/quick_tour/sessions/hello_world/templates/mytemplate.jinja2 index c7776144c..b8562709c 100644 --- a/docs/quick_tour/sessions/hello_world/templates/mytemplate.jinja2 +++ b/docs/quick_tour/sessions/hello_world/templates/mytemplate.jinja2 @@ -3,7 +3,7 @@ {% block content %}

Pyramid Starter project

-

Welcome to hello_world, a Pyramid application generated by
Cookiecutter.

+

Welcome to {{project}}, a Pyramid application generated by
Cookiecutter.

Counter: {{ request.session.counter }}

{% endblock content %} diff --git a/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 b/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 index 03f07524a..904fa442f 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 +++ b/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 @@ -11,7 +11,7 @@ Cookiecutter Alchemy project for the Pyramid Web Framework - + @@ -19,7 +19,7 @@ @@ -58,7 +58,7 @@ - - + + diff --git a/docs/quick_tour/sqla_demo/sqla_demo/templates/mytemplate.jinja2 b/docs/quick_tour/sqla_demo/sqla_demo/templates/mytemplate.jinja2 index bd00845d5..26d72c0a6 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/templates/mytemplate.jinja2 +++ b/docs/quick_tour/sqla_demo/sqla_demo/templates/mytemplate.jinja2 @@ -3,6 +3,6 @@ {% block content %}

Pyramid Alchemy project

-

Welcome to sqla_demo, a Pyramid application generated by
Cookiecutter.

+

Welcome to {{project}}, a Pyramid application generated by
Cookiecutter.

{% endblock content %} -- cgit v1.2.3