From 2cd38132e9d6b3506018ae892278d4b7da0d8119 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 28 Feb 2017 13:52:46 -0800 Subject: update pyramid-cookiecutter-starter prompts and reformat presentation of all cookiecutter prompts --- docs/quick_tutorial/cookiecutters.rst | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/cookiecutters.rst b/docs/quick_tutorial/cookiecutters.rst index 8e7048f78..f7251618f 100644 --- a/docs/quick_tutorial/cookiecutters.rst +++ b/docs/quick_tutorial/cookiecutters.rst @@ -32,9 +32,16 @@ Steps If prompted for the first item, accept the default ``yes`` by hitting return. - #. ``You've cloned ~/.cookiecutters/pyramid-cookiecutter-starter before. Is it okay to delete and re-clone it? [yes]:`` - #. ``project_name [Pyramid Scaffold]: cc_starter`` - #. ``repo_name [scaffold]: cc_starter`` + .. code-block:: text + + You've cloned ~/.cookiecutters/pyramid-cookiecutter-starter before. + Is it okay to delete and re-clone it? [yes]: yes + project_name [Pyramid Scaffold]: cc_starter + repo_name [scaffold]: cc_starter + Select template_language: + 1 - jinja2 + 2 - chameleon + Choose from 1, 2 [1]: 1 #. We then run through the following commands. -- cgit v1.2.3 From 6204d8de5484bf7fa26dd41fd32ee3fd9a1047db Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 14 Mar 2017 02:56:00 -0700 Subject: add Mako to options for pyramid-cookiecutter-starter --- docs/quick_tutorial/cookiecutters.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/cookiecutters.rst b/docs/quick_tutorial/cookiecutters.rst index f7251618f..edfd8cd69 100644 --- a/docs/quick_tutorial/cookiecutters.rst +++ b/docs/quick_tutorial/cookiecutters.rst @@ -41,7 +41,8 @@ Steps Select template_language: 1 - jinja2 2 - chameleon - Choose from 1, 2 [1]: 1 + 3 - mako + Choose from 1, 2, 3 [1]: 1 #. We then run through the following commands. -- cgit v1.2.3 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_tutorial/cookiecutters/development.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/cookiecutters/development.ini b/docs/quick_tutorial/cookiecutters/development.ini index 86b54b51d..a5093fb52 100644 --- a/docs/quick_tutorial/cookiecutters/development.ini +++ b/docs/quick_tutorial/cookiecutters/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 -- cgit v1.2.3 From 6ff6fa265cb48a48daa61247bb1a068852ad13c0 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 23 Apr 2017 23:59:48 -0700 Subject: update user prompt for cookiecutter repo_name - refs: https://github.com/Pylons/pyramid-cookiecutter-starter/pull/27#issuecomment-296507821 --- docs/quick_tutorial/cookiecutters.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/cookiecutters.rst b/docs/quick_tutorial/cookiecutters.rst index edfd8cd69..337a5c535 100644 --- a/docs/quick_tutorial/cookiecutters.rst +++ b/docs/quick_tutorial/cookiecutters.rst @@ -37,7 +37,7 @@ Steps You've cloned ~/.cookiecutters/pyramid-cookiecutter-starter before. Is it okay to delete and re-clone it? [yes]: yes project_name [Pyramid Scaffold]: cc_starter - repo_name [scaffold]: cc_starter + repo_name [cc_starter]: cc_starter Select template_language: 1 - jinja2 2 - chameleon -- 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_tutorial/cookiecutters/README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/cookiecutters/README.txt b/docs/quick_tutorial/cookiecutters/README.txt index 4b1f31bf3..55c5dcec6 100644 --- a/docs/quick_tutorial/cookiecutters/README.txt +++ b/docs/quick_tutorial/cookiecutters/README.txt @@ -1,5 +1,5 @@ cc_starter -=============================== +========== Getting Started --------------- -- cgit v1.2.3 From 0b92dfed800117595ef00fb2847c5db9970f4cac Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 9 May 2017 12:00:33 -0700 Subject: use new TLD for pytest-cov --- docs/quick_tutorial/unit_testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/unit_testing.rst b/docs/quick_tutorial/unit_testing.rst index 7c85d5289..002c62fde 100644 --- a/docs/quick_tutorial/unit_testing.rst +++ b/docs/quick_tutorial/unit_testing.rst @@ -29,7 +29,7 @@ broken the code. As you're writing your code, you might find this more convenient than changing to your browser constantly and clicking reload. We'll also leave discussion of `pytest-cov -`_ for another section. +`_ for another section. Objectives -- 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 --- .../cookiecutters/cc_starter/templates/layout.jinja2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 b/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 index 20da74879..3aed0a123 100644 --- a/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 +++ b/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 @@ -18,8 +18,8 @@ @@ -58,7 +58,7 @@ - - + + -- cgit v1.2.3 From d179ce929d800fb5a8a43e9fece625cdd2eba25f Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Thu, 1 Jun 2017 18:10:25 -0700 Subject: use shortcut for github URL; update RELEASING.txt - refs: #3042 --- docs/quick_tutorial/cookiecutters.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/cookiecutters.rst b/docs/quick_tutorial/cookiecutters.rst index 337a5c535..36ec700f0 100644 --- a/docs/quick_tutorial/cookiecutters.rst +++ b/docs/quick_tutorial/cookiecutters.rst @@ -28,7 +28,7 @@ Steps .. code-block:: bash - $ $VENV/bin/cookiecutter https://github.com/Pylons/pyramid-cookiecutter-starter + $ $VENV/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-starter If prompted for the first item, accept the default ``yes`` by hitting return. -- cgit v1.2.3 From c3bb231f4bb36fd30cdf740607c3faeb5b4a1ee5 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 2 Jun 2017 12:56:14 -0700 Subject: append ` --checkout master` to cookie cutter command --- docs/quick_tutorial/cookiecutters.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/cookiecutters.rst b/docs/quick_tutorial/cookiecutters.rst index 36ec700f0..f8568206d 100644 --- a/docs/quick_tutorial/cookiecutters.rst +++ b/docs/quick_tutorial/cookiecutters.rst @@ -28,7 +28,7 @@ Steps .. code-block:: bash - $ $VENV/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-starter + $ $VENV/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-starter --checkout master If prompted for the first item, accept the default ``yes`` by hitting return. -- cgit v1.2.3 From 1aa283fac740cf5ca7e6c9a02c6cc1366e328fe8 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 2 Jun 2017 13:05:39 -0700 Subject: mid-release cycle will be the death of me --- docs/quick_tutorial/cookiecutters.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/cookiecutters.rst b/docs/quick_tutorial/cookiecutters.rst index f8568206d..0f2a24816 100644 --- a/docs/quick_tutorial/cookiecutters.rst +++ b/docs/quick_tutorial/cookiecutters.rst @@ -28,7 +28,7 @@ Steps .. code-block:: bash - $ $VENV/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-starter --checkout master + $ $VENV/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-starter --checkout 1.9-branch If prompted for the first item, accept the default ``yes`` by hitting return. -- 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_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 b/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 index 3aed0a123..175a7b30b 100644 --- a/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 +++ b/docs/quick_tutorial/cookiecutters/cc_starter/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_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 b/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 index 175a7b30b..2d8a341d9 100644 --- a/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 +++ b/docs/quick_tutorial/cookiecutters/cc_starter/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_tutorial/cookiecutters/development.ini | 4 ++-- docs/quick_tutorial/cookiecutters/production.ini | 4 ++-- docs/quick_tutorial/functional_testing.rst | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/cookiecutters/development.ini b/docs/quick_tutorial/cookiecutters/development.ini index a5093fb52..ec621169d 100644 --- a/docs/quick_tutorial/cookiecutters/development.ini +++ b/docs/quick_tutorial/cookiecutters/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_tutorial/cookiecutters/production.ini b/docs/quick_tutorial/cookiecutters/production.ini index e24a065b1..8d2b9c79d 100644 --- a/docs/quick_tutorial/cookiecutters/production.ini +++ b/docs/quick_tutorial/cookiecutters/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_tutorial/functional_testing.rst b/docs/quick_tutorial/functional_testing.rst index 33793578a..518e3d67d 100644 --- a/docs/quick_tutorial/functional_testing.rst +++ b/docs/quick_tutorial/functional_testing.rst @@ -14,7 +14,7 @@ Unit tests are a common and popular approach to test-driven development (TDD). In web applications, though, the templating and entire apparatus of a web site are important parts of the delivered quality. We'd like a way to test these. -`WebTest `_ is a +`WebTest `_ is a Python package that does functional testing. With WebTest you can write tests which simulate a full HTTP request against a WSGI application, then test the information in the response. For speed purposes, WebTest skips the -- cgit v1.2.3 From 884eb55bbaef486deadb629d87abc0bf46a11719 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Tue, 27 Jun 2017 00:10:12 -0500 Subject: prep 1.10.dev0 --- docs/quick_tutorial/cookiecutters.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/cookiecutters.rst b/docs/quick_tutorial/cookiecutters.rst index 0f2a24816..f8568206d 100644 --- a/docs/quick_tutorial/cookiecutters.rst +++ b/docs/quick_tutorial/cookiecutters.rst @@ -28,7 +28,7 @@ Steps .. code-block:: bash - $ $VENV/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-starter --checkout 1.9-branch + $ $VENV/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-starter --checkout master If prompted for the first item, accept the default ``yes`` by hitting return. -- cgit v1.2.3 From a816a883492d530c50183e92d5a43fab07181114 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Jun 2017 01:05:41 -0700 Subject: Update all external links per `make linkcheck` - Most are changing http to https, or readthedocs.org to readthedocs.io, and some for Python packaging reorganizing some docs into tutorials, as well as miscellaneous changes. --- docs/quick_tutorial/package.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/package.rst b/docs/quick_tutorial/package.rst index 94cb39fc9..66bafcdb9 100644 --- a/docs/quick_tutorial/package.rst +++ b/docs/quick_tutorial/package.rst @@ -108,4 +108,4 @@ idea to run a Python module inside a package directly as a script. .. seealso:: :ref:`Python Packages ` and `Working in "Development Mode" - `_. + `_. -- cgit v1.2.3 From 66bb386b5f8a0b46f767e79960501329ec362d0c Mon Sep 17 00:00:00 2001 From: Caio Carrara Date: Sun, 2 Jul 2017 02:56:03 -0300 Subject: Fix doc typo --- docs/quick_tutorial/debugtoolbar.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/debugtoolbar.rst b/docs/quick_tutorial/debugtoolbar.rst index b02363d40..4402fcdbd 100644 --- a/docs/quick_tutorial/debugtoolbar.rst +++ b/docs/quick_tutorial/debugtoolbar.rst @@ -75,7 +75,7 @@ configuration for the debugtoolbar. You'll now see an attractive button on the right side of your browser, which you may click to provide introspective access to debugging information in a new -rowser tab. Even better, if your web application generates an error, you will +browser tab. Even better, if your web application generates an error, you will see a nice traceback on the screen. When you want to disable this toolbar, there's no need to change code: you can remove it from ``pyramid.includes`` in the relevant ``.ini`` configuration file (thus showing why configuration files -- 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_tutorial/hello_world/app.py | 8 ++++---- docs/quick_tutorial/package/tutorial/app.py | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/hello_world/app.py b/docs/quick_tutorial/hello_world/app.py index 0a95f9ad3..d0351e251 100644 --- a/docs/quick_tutorial/hello_world/app.py +++ b/docs/quick_tutorial/hello_world/app.py @@ -9,9 +9,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_tutorial/package/tutorial/app.py b/docs/quick_tutorial/package/tutorial/app.py index 210075023..d0351e251 100644 --- a/docs/quick_tutorial/package/tutorial/app.py +++ b/docs/quick_tutorial/package/tutorial/app.py @@ -4,14 +4,14 @@ from pyramid.response import Response def hello_world(request): - print ('Incoming request') + print('Incoming request') return Response('

Hello World!

') 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() \ No newline at end of file + server.serve_forever() -- cgit v1.2.3 From 8d0cf35c060031e89482135074f8bb46c8028dc0 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 3 Jul 2017 21:16:12 -0700 Subject: Add a term for context manager in Quick Tutorial --- docs/quick_tutorial/hello_world.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/hello_world.rst b/docs/quick_tutorial/hello_world.rst index 2f2515fcd..94242f1f4 100644 --- a/docs/quick_tutorial/hello_world.rst +++ b/docs/quick_tutorial/hello_world.rst @@ -75,7 +75,7 @@ explanation: "Start here when running from the command line", rather than when this module is imported. -#. *Lines 12-14*. Use Pyramid's :term:`configurator` to connect :term:`view` +#. *Lines 12-14*. Use Pyramid's :term:`configurator` in a :term:`context manager` to connect :term:`view` code to a particular URL :term:`route`. #. *Lines 6-8*. Implement the view code that generates the :term:`response`. -- cgit v1.2.3 From 75a098c4a25542ebdef74c57aa15c70242ca9485 Mon Sep 17 00:00:00 2001 From: Lars Alexander Blumberg Date: Mon, 14 Aug 2017 10:11:56 +0200 Subject: Add missing word to jinja2 tutorials page --- docs/quick_tutorial/jinja2.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/jinja2.rst b/docs/quick_tutorial/jinja2.rst index 2fc68827b..4faa81fc4 100644 --- a/docs/quick_tutorial/jinja2.rst +++ b/docs/quick_tutorial/jinja2.rst @@ -85,7 +85,7 @@ Extra credit #. We used ``config.include`` which is an imperative configuration to get the :term:`Configurator` to load ``pyramid_jinja2``'s configuration. What is - another way could include it into the config? + another way we could include it into the config? .. seealso:: `Jinja2 homepage `_, and :ref:`pyramid_jinja2 Overview ` -- cgit v1.2.3 From 665d2ecdff976915a4f2864623d5546d41db7a4c Mon Sep 17 00:00:00 2001 From: Lars Alexander Blumberg Date: Mon, 14 Aug 2017 10:39:00 +0200 Subject: Add functional test for css file Static files were introduced in this tutorial step. As the tutorials emphasise to write tests, this commits adds a test for the static file `app.css` that was introduced with this tutorial step. --- docs/quick_tutorial/static_assets/tutorial/tests.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/static_assets/tutorial/tests.py b/docs/quick_tutorial/static_assets/tutorial/tests.py index 4381235ec..b560ddf82 100644 --- a/docs/quick_tutorial/static_assets/tutorial/tests.py +++ b/docs/quick_tutorial/static_assets/tutorial/tests.py @@ -42,3 +42,7 @@ class TutorialFunctionalTests(unittest.TestCase): def test_hello(self): res = self.testapp.get('/howdy', status=200) self.assertIn(b'

Hi Hello View', res.body) + + def test_css(self): + res = self.testapp.get('/static/app.css', status=200) + self.assertIn(b'body', res.body) -- cgit v1.2.3 From 85d87f3614d960593a1b2b2d791df1f9bca50bfa Mon Sep 17 00:00:00 2001 From: Lars Blumberg Date: Mon, 14 Aug 2017 10:55:05 +0200 Subject: Update wording on tutorial page --- docs/quick_tutorial/view_classes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/view_classes.rst b/docs/quick_tutorial/view_classes.rst index 05d97a9b1..49cdcddcc 100644 --- a/docs/quick_tutorial/view_classes.rst +++ b/docs/quick_tutorial/view_classes.rst @@ -12,7 +12,7 @@ Background ========== So far our views have been simple, free-standing functions. Many times your -views are related to one another. They may be different ways to look at or work +views are related to one another. They may consist of different ways to look at or work on the same data, or be a REST API that handles multiple operations. Grouping these views together as a :ref:`view class ` makes sense: -- cgit v1.2.3 From acc4058e231f3e03a32b17f923c0d5b163c63b03 Mon Sep 17 00:00:00 2001 From: Lars Alexander Blumberg Date: Mon, 14 Aug 2017 10:43:01 +0200 Subject: Add a functional test for the static file --- docs/quick_tutorial/static_assets.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/static_assets.rst b/docs/quick_tutorial/static_assets.rst index b8482492d..3235f8561 100644 --- a/docs/quick_tutorial/static_assets.rst +++ b/docs/quick_tutorial/static_assets.rst @@ -43,13 +43,18 @@ Steps .. literalinclude:: static_assets/tutorial/static/app.css :language: css -#. Make sure we haven't broken any existing code by running the tests: +#. We add a functional test that asserts that the newly added static file is delivered: + + .. literalinclude:: static_assets/tutorial/tests.py + :linenos: + +#. Now run the tests: .. code-block:: bash $ $VENV/bin/py.test tutorial/tests.py -q .... - 4 passed in 0.50 seconds + 5 passed in 0.50 seconds #. Run your Pyramid application with: -- cgit v1.2.3 From c6ede2dbca90b4fa752a9dfe35dbb1325e522498 Mon Sep 17 00:00:00 2001 From: Lars Alexander Blumberg Date: Tue, 15 Aug 2017 09:43:42 +0200 Subject: Only include test code snippet that has been added --- docs/quick_tutorial/static_assets.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/static_assets.rst b/docs/quick_tutorial/static_assets.rst index 3235f8561..81a01061a 100644 --- a/docs/quick_tutorial/static_assets.rst +++ b/docs/quick_tutorial/static_assets.rst @@ -46,7 +46,9 @@ Steps #. We add a functional test that asserts that the newly added static file is delivered: .. literalinclude:: static_assets/tutorial/tests.py - :linenos: + :language: python + :pyobject: TutorialFunctionalTests.test_css + :lineno-match: #. Now run the tests: -- cgit v1.2.3 From cfc8fbe0e1380c06b01643f8310ae59ea0af820b Mon Sep 17 00:00:00 2001 From: Chris Shenton Date: Sat, 21 Oct 2017 15:35:25 +0200 Subject: Quick Tutorial: Replace wsgiref with waitress In setup.py add waitress import. In development.ini use waitress. Adjust line number highlighting. Mention that we're using it early in the tutorial. Addresses #2926 --- docs/quick_tutorial/authentication.rst | 2 +- docs/quick_tutorial/authentication/development.ini | 4 ++-- docs/quick_tutorial/authentication/setup.py | 1 + docs/quick_tutorial/authorization/development.ini | 4 ++-- docs/quick_tutorial/authorization/setup.py | 3 ++- docs/quick_tutorial/databases/development.ini | 4 ++-- docs/quick_tutorial/databases/setup.py | 1 + docs/quick_tutorial/debugtoolbar/development.ini | 4 ++-- docs/quick_tutorial/debugtoolbar/setup.py | 3 ++- docs/quick_tutorial/forms.rst | 2 +- docs/quick_tutorial/forms/development.ini | 4 ++-- docs/quick_tutorial/forms/setup.py | 3 ++- docs/quick_tutorial/functional_testing/development.ini | 4 ++-- docs/quick_tutorial/functional_testing/setup.py | 1 + docs/quick_tutorial/hello_world/app.py | 5 ++--- docs/quick_tutorial/ini.rst | 11 ++++++----- docs/quick_tutorial/ini/development.ini | 4 ++-- docs/quick_tutorial/ini/setup.py | 1 + docs/quick_tutorial/jinja2/development.ini | 4 ++-- docs/quick_tutorial/jinja2/setup.py | 1 + docs/quick_tutorial/json/development.ini | 4 ++-- docs/quick_tutorial/json/setup.py | 1 + docs/quick_tutorial/logging/development.ini | 4 ++-- docs/quick_tutorial/logging/setup.py | 1 + docs/quick_tutorial/more_view_classes/development.ini | 4 ++-- docs/quick_tutorial/more_view_classes/setup.py | 1 + docs/quick_tutorial/package/tutorial/app.py | 5 ++--- docs/quick_tutorial/request_response/development.ini | 4 ++-- docs/quick_tutorial/request_response/setup.py | 1 + docs/quick_tutorial/requirements.rst | 7 ++++--- docs/quick_tutorial/retail_forms/development.ini | 4 ++-- docs/quick_tutorial/retail_forms/setup.py | 1 + docs/quick_tutorial/routing/development.ini | 4 ++-- docs/quick_tutorial/routing/setup.py | 1 + docs/quick_tutorial/sessions/development.ini | 4 ++-- docs/quick_tutorial/sessions/setup.py | 1 + docs/quick_tutorial/static_assets/development.ini | 4 ++-- docs/quick_tutorial/static_assets/setup.py | 1 + docs/quick_tutorial/templating/development.ini | 4 ++-- docs/quick_tutorial/templating/setup.py | 1 + docs/quick_tutorial/unit_testing/development.ini | 4 ++-- docs/quick_tutorial/unit_testing/setup.py | 1 + docs/quick_tutorial/view_classes/development.ini | 4 ++-- docs/quick_tutorial/view_classes/setup.py | 1 + docs/quick_tutorial/views/development.ini | 4 ++-- docs/quick_tutorial/views/setup.py | 1 + 46 files changed, 79 insertions(+), 59 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/authentication.rst b/docs/quick_tutorial/authentication.rst index 892beb3ec..b940f1086 100644 --- a/docs/quick_tutorial/authentication.rst +++ b/docs/quick_tutorial/authentication.rst @@ -39,7 +39,7 @@ Steps .. literalinclude:: authentication/setup.py :language: python - :emphasize-lines: 5-6 + :emphasize-lines: 6-7 :linenos: #. We can now install our project in development mode: diff --git a/docs/quick_tutorial/authentication/development.ini b/docs/quick_tutorial/authentication/development.ini index a4586d45f..cae509542 100644 --- a/docs/quick_tutorial/authentication/development.ini +++ b/docs/quick_tutorial/authentication/development.ini @@ -6,5 +6,5 @@ pyramid.includes = tutorial.secret = 98zd [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/authentication/setup.py b/docs/quick_tutorial/authentication/setup.py index 7a6ff4226..808a6f9a9 100644 --- a/docs/quick_tutorial/authentication/setup.py +++ b/docs/quick_tutorial/authentication/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', 'pyramid_chameleon', 'bcrypt' ] diff --git a/docs/quick_tutorial/authorization/development.ini b/docs/quick_tutorial/authorization/development.ini index a4586d45f..cae509542 100644 --- a/docs/quick_tutorial/authorization/development.ini +++ b/docs/quick_tutorial/authorization/development.ini @@ -6,5 +6,5 @@ pyramid.includes = tutorial.secret = 98zd [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/authorization/setup.py b/docs/quick_tutorial/authorization/setup.py index 7a6ff4226..0da300ba0 100644 --- a/docs/quick_tutorial/authorization/setup.py +++ b/docs/quick_tutorial/authorization/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', 'pyramid_chameleon', 'bcrypt' ] @@ -12,4 +13,4 @@ setup(name='tutorial', [paste.app_factory] main = tutorial:main """, -) \ No newline at end of file +) diff --git a/docs/quick_tutorial/databases/development.ini b/docs/quick_tutorial/databases/development.ini index 270643071..270cf7b63 100644 --- a/docs/quick_tutorial/databases/development.ini +++ b/docs/quick_tutorial/databases/development.ini @@ -8,8 +8,8 @@ pyramid.includes = sqlalchemy.url = sqlite:///%(here)s/sqltutorial.sqlite [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 # Begin logging configuration diff --git a/docs/quick_tutorial/databases/setup.py b/docs/quick_tutorial/databases/setup.py index 238358fe4..66045fd7e 100644 --- a/docs/quick_tutorial/databases/setup.py +++ b/docs/quick_tutorial/databases/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', 'pyramid_chameleon', 'deform', 'sqlalchemy', diff --git a/docs/quick_tutorial/debugtoolbar/development.ini b/docs/quick_tutorial/debugtoolbar/development.ini index 17b479011..58d23cff7 100644 --- a/docs/quick_tutorial/debugtoolbar/development.ini +++ b/docs/quick_tutorial/debugtoolbar/development.ini @@ -4,5 +4,5 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/debugtoolbar/setup.py b/docs/quick_tutorial/debugtoolbar/setup.py index 9997984d3..39a045af0 100644 --- a/docs/quick_tutorial/debugtoolbar/setup.py +++ b/docs/quick_tutorial/debugtoolbar/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', ] setup(name='tutorial', @@ -10,4 +11,4 @@ setup(name='tutorial', [paste.app_factory] main = tutorial:main """, -) \ No newline at end of file +) diff --git a/docs/quick_tutorial/forms.rst b/docs/quick_tutorial/forms.rst index 84ceb13d6..74cce75c1 100644 --- a/docs/quick_tutorial/forms.rst +++ b/docs/quick_tutorial/forms.rst @@ -41,7 +41,7 @@ Steps pulls in Colander as a dependency: .. literalinclude:: forms/setup.py - :emphasize-lines: 5-6 + :emphasize-lines: 6-7 :linenos: #. We can now install our project in development mode: diff --git a/docs/quick_tutorial/forms/development.ini b/docs/quick_tutorial/forms/development.ini index 7066668bf..78d7479e7 100644 --- a/docs/quick_tutorial/forms/development.ini +++ b/docs/quick_tutorial/forms/development.ini @@ -5,5 +5,5 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/forms/setup.py b/docs/quick_tutorial/forms/setup.py index 361ade013..9671e609b 100644 --- a/docs/quick_tutorial/forms/setup.py +++ b/docs/quick_tutorial/forms/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', 'pyramid_chameleon', 'deform' ] @@ -12,4 +13,4 @@ setup(name='tutorial', [paste.app_factory] main = tutorial:main """, -) \ No newline at end of file +) diff --git a/docs/quick_tutorial/functional_testing/development.ini b/docs/quick_tutorial/functional_testing/development.ini index 17b479011..58d23cff7 100644 --- a/docs/quick_tutorial/functional_testing/development.ini +++ b/docs/quick_tutorial/functional_testing/development.ini @@ -4,5 +4,5 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/functional_testing/setup.py b/docs/quick_tutorial/functional_testing/setup.py index 9997984d3..a93cf6a73 100644 --- a/docs/quick_tutorial/functional_testing/setup.py +++ b/docs/quick_tutorial/functional_testing/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', ] setup(name='tutorial', diff --git a/docs/quick_tutorial/hello_world/app.py b/docs/quick_tutorial/hello_world/app.py index d0351e251..ff0b950d3 100644 --- a/docs/quick_tutorial/hello_world/app.py +++ b/docs/quick_tutorial/hello_world/app.py @@ -1,4 +1,4 @@ -from wsgiref.simple_server import make_server +from waitress import serve from pyramid.config import Configurator from pyramid.response import Response @@ -13,5 +13,4 @@ if __name__ == '__main__': 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() + serve(app, host='0.0.0.0', port=6543) diff --git a/docs/quick_tutorial/ini.rst b/docs/quick_tutorial/ini.rst index 96dfc5b5f..c478d6784 100644 --- a/docs/quick_tutorial/ini.rst +++ b/docs/quick_tutorial/ini.rst @@ -89,7 +89,7 @@ application. Processing then proceeds as described in the Pyramid chapter on - ``pserve`` looks for ``[app:main]`` and finds ``use = egg:tutorial``. -- The projects's ``setup.py`` has defined an "entry point" (lines 9-12) for the +- The projects's ``setup.py`` has defined an "entry point" (lines 10-13) for the project's "main" entry point of ``tutorial:main``. - The ``tutorial`` package's ``__init__`` has a ``main`` function. @@ -99,10 +99,11 @@ application. Processing then proceeds as described in the Pyramid chapter on The ``.ini`` file is also used for two other functions: -- *Configuring the WSGI server*. ``[server:main]`` wires up the choice of which - WSGI *server* for your WSGI *application*. In this case, we are using - ``wsgiref`` bundled in the Python library. It also wires up the *port - number*: ``port = 6543`` tells ``wsgiref`` to listen on port 6543. +- *Configuring the WSGI server*. ``[server:main]`` wires up the choice + of which WSGI *server* for your WSGI *application*. In this case, we + are using ``waitress`` which was specified in + ``tutorial/setup.py``. It also wires up the *port number*: ``listen + = localhost:6543`` tells ``waitress`` to listen on port 6543. - *Configuring Python logging*. Pyramid uses Python standard logging, which needs a number of configuration values. The ``.ini`` serves this function. diff --git a/docs/quick_tutorial/ini/development.ini b/docs/quick_tutorial/ini/development.ini index cffbd66c9..5361188a3 100644 --- a/docs/quick_tutorial/ini/development.ini +++ b/docs/quick_tutorial/ini/development.ini @@ -2,5 +2,5 @@ use = egg:tutorial [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/ini/setup.py b/docs/quick_tutorial/ini/setup.py index 9997984d3..a93cf6a73 100644 --- a/docs/quick_tutorial/ini/setup.py +++ b/docs/quick_tutorial/ini/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', ] setup(name='tutorial', diff --git a/docs/quick_tutorial/jinja2/development.ini b/docs/quick_tutorial/jinja2/development.ini index 7066668bf..78d7479e7 100644 --- a/docs/quick_tutorial/jinja2/development.ini +++ b/docs/quick_tutorial/jinja2/development.ini @@ -5,5 +5,5 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/jinja2/setup.py b/docs/quick_tutorial/jinja2/setup.py index 9997984d3..a93cf6a73 100644 --- a/docs/quick_tutorial/jinja2/setup.py +++ b/docs/quick_tutorial/jinja2/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', ] setup(name='tutorial', diff --git a/docs/quick_tutorial/json/development.ini b/docs/quick_tutorial/json/development.ini index 7066668bf..78d7479e7 100644 --- a/docs/quick_tutorial/json/development.ini +++ b/docs/quick_tutorial/json/development.ini @@ -5,5 +5,5 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/json/setup.py b/docs/quick_tutorial/json/setup.py index 2221b72e9..aefa352d4 100644 --- a/docs/quick_tutorial/json/setup.py +++ b/docs/quick_tutorial/json/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', 'pyramid_chameleon' ] diff --git a/docs/quick_tutorial/logging/development.ini b/docs/quick_tutorial/logging/development.ini index b869ca5b6..ff470acdb 100644 --- a/docs/quick_tutorial/logging/development.ini +++ b/docs/quick_tutorial/logging/development.ini @@ -5,8 +5,8 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 # Begin logging configuration diff --git a/docs/quick_tutorial/logging/setup.py b/docs/quick_tutorial/logging/setup.py index 2221b72e9..aefa352d4 100644 --- a/docs/quick_tutorial/logging/setup.py +++ b/docs/quick_tutorial/logging/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', 'pyramid_chameleon' ] diff --git a/docs/quick_tutorial/more_view_classes/development.ini b/docs/quick_tutorial/more_view_classes/development.ini index 7066668bf..78d7479e7 100644 --- a/docs/quick_tutorial/more_view_classes/development.ini +++ b/docs/quick_tutorial/more_view_classes/development.ini @@ -5,5 +5,5 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/more_view_classes/setup.py b/docs/quick_tutorial/more_view_classes/setup.py index 2221b72e9..aefa352d4 100644 --- a/docs/quick_tutorial/more_view_classes/setup.py +++ b/docs/quick_tutorial/more_view_classes/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', 'pyramid_chameleon' ] diff --git a/docs/quick_tutorial/package/tutorial/app.py b/docs/quick_tutorial/package/tutorial/app.py index d0351e251..ff0b950d3 100644 --- a/docs/quick_tutorial/package/tutorial/app.py +++ b/docs/quick_tutorial/package/tutorial/app.py @@ -1,4 +1,4 @@ -from wsgiref.simple_server import make_server +from waitress import serve from pyramid.config import Configurator from pyramid.response import Response @@ -13,5 +13,4 @@ if __name__ == '__main__': 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() + serve(app, host='0.0.0.0', port=6543) diff --git a/docs/quick_tutorial/request_response/development.ini b/docs/quick_tutorial/request_response/development.ini index 7066668bf..78d7479e7 100644 --- a/docs/quick_tutorial/request_response/development.ini +++ b/docs/quick_tutorial/request_response/development.ini @@ -5,5 +5,5 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/request_response/setup.py b/docs/quick_tutorial/request_response/setup.py index 9997984d3..a93cf6a73 100644 --- a/docs/quick_tutorial/request_response/setup.py +++ b/docs/quick_tutorial/request_response/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', ] setup(name='tutorial', diff --git a/docs/quick_tutorial/requirements.rst b/docs/quick_tutorial/requirements.rst index 70e68514b..ad7ad1af1 100644 --- a/docs/quick_tutorial/requirements.rst +++ b/docs/quick_tutorial/requirements.rst @@ -194,12 +194,13 @@ part is pretty easy. .. parsed-literal:: # Mac and Linux - $ $VENV/bin/pip install "pyramid==\ |release|\ " + $ $VENV/bin/pip install "pyramid==\ |release|\ " waitress # Windows - c:\\> %VENV%\\Scripts\\pip install "pyramid==\ |release|\ " + c:\\> %VENV%\\Scripts\\pip install "pyramid==\ |release|\ " waitress -Our Python virtual environment now has the Pyramid software available. +Our Python virtual environment now has the Pyramid software available +as well as the ``waitress`` server. You can optionally install some of the extra Python packages used in this tutorial. diff --git a/docs/quick_tutorial/retail_forms/development.ini b/docs/quick_tutorial/retail_forms/development.ini index 7066668bf..78d7479e7 100644 --- a/docs/quick_tutorial/retail_forms/development.ini +++ b/docs/quick_tutorial/retail_forms/development.ini @@ -5,5 +5,5 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/retail_forms/setup.py b/docs/quick_tutorial/retail_forms/setup.py index 361ade013..5293ef7f0 100644 --- a/docs/quick_tutorial/retail_forms/setup.py +++ b/docs/quick_tutorial/retail_forms/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', 'pyramid_chameleon', 'deform' ] diff --git a/docs/quick_tutorial/routing/development.ini b/docs/quick_tutorial/routing/development.ini index 7066668bf..78d7479e7 100644 --- a/docs/quick_tutorial/routing/development.ini +++ b/docs/quick_tutorial/routing/development.ini @@ -5,5 +5,5 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/routing/setup.py b/docs/quick_tutorial/routing/setup.py index 2221b72e9..aefa352d4 100644 --- a/docs/quick_tutorial/routing/setup.py +++ b/docs/quick_tutorial/routing/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', 'pyramid_chameleon' ] diff --git a/docs/quick_tutorial/sessions/development.ini b/docs/quick_tutorial/sessions/development.ini index 7066668bf..78d7479e7 100644 --- a/docs/quick_tutorial/sessions/development.ini +++ b/docs/quick_tutorial/sessions/development.ini @@ -5,5 +5,5 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/sessions/setup.py b/docs/quick_tutorial/sessions/setup.py index 2221b72e9..aefa352d4 100644 --- a/docs/quick_tutorial/sessions/setup.py +++ b/docs/quick_tutorial/sessions/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', 'pyramid_chameleon' ] diff --git a/docs/quick_tutorial/static_assets/development.ini b/docs/quick_tutorial/static_assets/development.ini index 7066668bf..78d7479e7 100644 --- a/docs/quick_tutorial/static_assets/development.ini +++ b/docs/quick_tutorial/static_assets/development.ini @@ -5,5 +5,5 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/static_assets/setup.py b/docs/quick_tutorial/static_assets/setup.py index 2221b72e9..aefa352d4 100644 --- a/docs/quick_tutorial/static_assets/setup.py +++ b/docs/quick_tutorial/static_assets/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', 'pyramid_chameleon' ] diff --git a/docs/quick_tutorial/templating/development.ini b/docs/quick_tutorial/templating/development.ini index 7066668bf..78d7479e7 100644 --- a/docs/quick_tutorial/templating/development.ini +++ b/docs/quick_tutorial/templating/development.ini @@ -5,5 +5,5 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/templating/setup.py b/docs/quick_tutorial/templating/setup.py index 0b71b73e6..d1910178e 100644 --- a/docs/quick_tutorial/templating/setup.py +++ b/docs/quick_tutorial/templating/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', 'pyramid_chameleon', ] diff --git a/docs/quick_tutorial/unit_testing/development.ini b/docs/quick_tutorial/unit_testing/development.ini index 17b479011..58d23cff7 100644 --- a/docs/quick_tutorial/unit_testing/development.ini +++ b/docs/quick_tutorial/unit_testing/development.ini @@ -4,5 +4,5 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/unit_testing/setup.py b/docs/quick_tutorial/unit_testing/setup.py index 9997984d3..a93cf6a73 100644 --- a/docs/quick_tutorial/unit_testing/setup.py +++ b/docs/quick_tutorial/unit_testing/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', ] setup(name='tutorial', diff --git a/docs/quick_tutorial/view_classes/development.ini b/docs/quick_tutorial/view_classes/development.ini index 7066668bf..78d7479e7 100644 --- a/docs/quick_tutorial/view_classes/development.ini +++ b/docs/quick_tutorial/view_classes/development.ini @@ -5,5 +5,5 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/view_classes/setup.py b/docs/quick_tutorial/view_classes/setup.py index 2221b72e9..aefa352d4 100644 --- a/docs/quick_tutorial/view_classes/setup.py +++ b/docs/quick_tutorial/view_classes/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', 'pyramid_chameleon' ] diff --git a/docs/quick_tutorial/views/development.ini b/docs/quick_tutorial/views/development.ini index 17b479011..58d23cff7 100644 --- a/docs/quick_tutorial/views/development.ini +++ b/docs/quick_tutorial/views/development.ini @@ -4,5 +4,5 @@ pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/views/setup.py b/docs/quick_tutorial/views/setup.py index 9997984d3..a93cf6a73 100644 --- a/docs/quick_tutorial/views/setup.py +++ b/docs/quick_tutorial/views/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', ] setup(name='tutorial', -- cgit v1.2.3 From 088013637dfb4623bc3ea6588b6f08e827fecdd7 Mon Sep 17 00:00:00 2001 From: Chris Shenton Date: Sat, 21 Oct 2017 16:06:03 +0200 Subject: Force emacs not to add newlines gratuitously, un-add them --- docs/quick_tutorial/authorization/setup.py | 2 +- docs/quick_tutorial/debugtoolbar/setup.py | 2 +- docs/quick_tutorial/forms/setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/authorization/setup.py b/docs/quick_tutorial/authorization/setup.py index 0da300ba0..808a6f9a9 100644 --- a/docs/quick_tutorial/authorization/setup.py +++ b/docs/quick_tutorial/authorization/setup.py @@ -13,4 +13,4 @@ setup(name='tutorial', [paste.app_factory] main = tutorial:main """, -) +) \ No newline at end of file diff --git a/docs/quick_tutorial/debugtoolbar/setup.py b/docs/quick_tutorial/debugtoolbar/setup.py index 39a045af0..a93cf6a73 100644 --- a/docs/quick_tutorial/debugtoolbar/setup.py +++ b/docs/quick_tutorial/debugtoolbar/setup.py @@ -11,4 +11,4 @@ setup(name='tutorial', [paste.app_factory] main = tutorial:main """, -) +) \ No newline at end of file diff --git a/docs/quick_tutorial/forms/setup.py b/docs/quick_tutorial/forms/setup.py index 9671e609b..5293ef7f0 100644 --- a/docs/quick_tutorial/forms/setup.py +++ b/docs/quick_tutorial/forms/setup.py @@ -13,4 +13,4 @@ setup(name='tutorial', [paste.app_factory] main = tutorial:main """, -) +) \ No newline at end of file -- cgit v1.2.3 From 30bf7300404c1259d6558d58713933a5a067eeee Mon Sep 17 00:00:00 2001 From: Chris Shenton Date: Sat, 21 Oct 2017 19:26:06 +0200 Subject: Changes per stevepiercy review, thanks! --- docs/quick_tutorial/authentication.rst | 2 +- docs/quick_tutorial/forms.rst | 2 +- docs/quick_tutorial/ini.rst | 5 +++-- docs/quick_tutorial/requirements.rst | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/authentication.rst b/docs/quick_tutorial/authentication.rst index b940f1086..684cce6a6 100644 --- a/docs/quick_tutorial/authentication.rst +++ b/docs/quick_tutorial/authentication.rst @@ -39,7 +39,7 @@ Steps .. literalinclude:: authentication/setup.py :language: python - :emphasize-lines: 6-7 + :emphasize-lines: 7 :linenos: #. We can now install our project in development mode: diff --git a/docs/quick_tutorial/forms.rst b/docs/quick_tutorial/forms.rst index 74cce75c1..3c865ad09 100644 --- a/docs/quick_tutorial/forms.rst +++ b/docs/quick_tutorial/forms.rst @@ -41,7 +41,7 @@ Steps pulls in Colander as a dependency: .. literalinclude:: forms/setup.py - :emphasize-lines: 6-7 + :emphasize-lines: 7 :linenos: #. We can now install our project in development mode: diff --git a/docs/quick_tutorial/ini.rst b/docs/quick_tutorial/ini.rst index c478d6784..f6d64eeda 100644 --- a/docs/quick_tutorial/ini.rst +++ b/docs/quick_tutorial/ini.rst @@ -102,8 +102,9 @@ The ``.ini`` file is also used for two other functions: - *Configuring the WSGI server*. ``[server:main]`` wires up the choice of which WSGI *server* for your WSGI *application*. In this case, we are using ``waitress`` which was specified in - ``tutorial/setup.py``. It also wires up the *port number*: ``listen - = localhost:6543`` tells ``waitress`` to listen on port 6543. + ``tutorial/setup.py``. It also wires up the *port number*: + ``listen = localhost:6543`` tells ``waitress`` to listen on host + ``localhost`` at port ``6543``. - *Configuring Python logging*. Pyramid uses Python standard logging, which needs a number of configuration values. The ``.ini`` serves this function. diff --git a/docs/quick_tutorial/requirements.rst b/docs/quick_tutorial/requirements.rst index ad7ad1af1..a65cfe6d2 100644 --- a/docs/quick_tutorial/requirements.rst +++ b/docs/quick_tutorial/requirements.rst @@ -189,7 +189,7 @@ Install Pyramid --------------- We have our Python standard prerequisites out of the way. The Pyramid -part is pretty easy. +part is pretty easy. We'll also install a WSGI server, Waitress. .. parsed-literal:: @@ -200,7 +200,7 @@ part is pretty easy. c:\\> %VENV%\\Scripts\\pip install "pyramid==\ |release|\ " waitress Our Python virtual environment now has the Pyramid software available -as well as the ``waitress`` server. +as well as the ``waitress`` package. You can optionally install some of the extra Python packages used in this tutorial. -- cgit v1.2.3 From b83d693d23b3f1d96cfbe8ea7bd8b9cd404b7b7c Mon Sep 17 00:00:00 2001 From: silum Date: Fri, 3 Nov 2017 18:30:44 +0200 Subject: views.py: prevent exception on unknown user login Attempting authentication without specifying a login, or when the login is not known, causes an unhandled exception to be raised in `security.py` because `None` is passed to `check_password()` as the hashed password to check against. --- docs/quick_tutorial/authentication/tutorial/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/authentication/tutorial/views.py b/docs/quick_tutorial/authentication/tutorial/views.py index b07538d5e..b2d9354ec 100644 --- a/docs/quick_tutorial/authentication/tutorial/views.py +++ b/docs/quick_tutorial/authentication/tutorial/views.py @@ -43,7 +43,8 @@ class TutorialViews: if 'form.submitted' in request.params: login = request.params['login'] password = request.params['password'] - if check_password(password, USERS.get(login)): + hashed_pw = USERS.get(login) + if hashed_pw and check_password(password, hashed_pw): headers = remember(request, login) return HTTPFound(location=came_from, headers=headers) -- cgit v1.2.3 From 5fc14d6868898d7b6044086638ebe9c2c5ed1b71 Mon Sep 17 00:00:00 2001 From: silum Date: Fri, 3 Nov 2017 19:31:43 +0200 Subject: views.py: prevent exception on unknown user login --- docs/quick_tutorial/authorization/tutorial/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/authorization/tutorial/views.py b/docs/quick_tutorial/authorization/tutorial/views.py index b2dc905c0..3876efb1c 100644 --- a/docs/quick_tutorial/authorization/tutorial/views.py +++ b/docs/quick_tutorial/authorization/tutorial/views.py @@ -45,7 +45,8 @@ class TutorialViews: if 'form.submitted' in request.params: login = request.params['login'] password = request.params['password'] - if check_password(password, USERS.get(login)): + hashed_pw = USERS.get(login) + if hashed_pw and check_password(password, hashed_pw): headers = remember(request, login) return HTTPFound(location=came_from, headers=headers) -- cgit v1.2.3 From 2a84a443831be7bf398b10b75b891c25a3f889e7 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 1 Dec 2017 10:40:59 -0800 Subject: Clarify when and how waitress is installed. - see #3204 --- docs/quick_tutorial/ini.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/ini.rst b/docs/quick_tutorial/ini.rst index f6d64eeda..e4f30405f 100644 --- a/docs/quick_tutorial/ini.rst +++ b/docs/quick_tutorial/ini.rst @@ -101,11 +101,13 @@ The ``.ini`` file is also used for two other functions: - *Configuring the WSGI server*. ``[server:main]`` wires up the choice of which WSGI *server* for your WSGI *application*. In this case, we - are using ``waitress`` which was specified in - ``tutorial/setup.py``. It also wires up the *port number*: + are using ``waitress`` which we specified in + ``tutorial/setup.py`` and was installed in the :doc:`requirements` step at the start of this tutorial. It also wires up the *port number*: ``listen = localhost:6543`` tells ``waitress`` to listen on host ``localhost`` at port ``6543``. + .. note:: Running the command ``$VENV/bin/pip install -e .`` will check for previously installed packages in our virtual environment that are specified in our package's ``setup.py`` file, then install our package in editable mode, installing any requirements that were not previously installed. If a requirement was manually installed previously on the command line or otherwise, in this case Waitress, then ``$VENV/bin/pip install -e .`` will merely check that it is installed and move on. + - *Configuring Python logging*. Pyramid uses Python standard logging, which needs a number of configuration values. The ``.ini`` serves this function. This provides the console log output that you see on startup and each -- 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) --- .../cookiecutters/cc_starter/templates/layout.jinja2 | 8 ++++---- .../cookiecutters/cc_starter/templates/mytemplate.jinja2 | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 b/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 index 2d8a341d9..13a65ff72 100644 --- a/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 +++ b/docs/quick_tutorial/cookiecutters/cc_starter/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_tutorial/cookiecutters/cc_starter/templates/mytemplate.jinja2 b/docs/quick_tutorial/cookiecutters/cc_starter/templates/mytemplate.jinja2 index 979ee5071..f2e7283f8 100644 --- a/docs/quick_tutorial/cookiecutters/cc_starter/templates/mytemplate.jinja2 +++ b/docs/quick_tutorial/cookiecutters/cc_starter/templates/mytemplate.jinja2 @@ -3,6 +3,6 @@ {% block content %}

Pyramid Starter project

-

Welcome to cc_starter, a Pyramid application generated by
Cookiecutter.

+

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

{% endblock content %} -- cgit v1.2.3 From 681a79f56cae6c21103f75c7062679ed8b449322 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Mon, 26 Feb 2018 02:07:25 -0600 Subject: fix broken link --- docs/quick_tutorial/routing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/routing.rst b/docs/quick_tutorial/routing.rst index d88adfa1e..adbe76a62 100644 --- a/docs/quick_tutorial/routing.rst +++ b/docs/quick_tutorial/routing.rst @@ -121,4 +121,4 @@ Extra credit result that you expected? .. seealso:: `Weird Stuff You Can Do With URL Dispatch - `_ + `_ -- cgit v1.2.3