Steve Piercy
2017-10-22 4567204570eff25408278fd01919c1b048b9f7f1
Feature/gh#2926 quick tutorial wsgiref to waitress
- backport #3180 to 1.9-branch
46 files modified
135 ■■■■■ changed files
docs/quick_tutorial/authentication.rst 2 ●●● patch | view | raw | blame | history
docs/quick_tutorial/authentication/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/authentication/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/authorization/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/authorization/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/databases/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/databases/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/debugtoolbar/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/debugtoolbar/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/forms.rst 2 ●●● patch | view | raw | blame | history
docs/quick_tutorial/forms/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/forms/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/functional_testing/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/functional_testing/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/hello_world/app.py 5 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/ini.rst 12 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/ini/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/ini/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/jinja2/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/jinja2/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/json/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/json/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/logging/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/logging/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/more_view_classes/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/more_view_classes/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/package/tutorial/app.py 5 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/request_response/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/request_response/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/requirements.rst 9 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/retail_forms/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/retail_forms/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/routing/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/routing/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/sessions/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/sessions/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/static_assets/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/static_assets/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/templating/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/templating/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/unit_testing/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/unit_testing/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/view_classes/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/view_classes/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/views/development.ini 4 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/views/setup.py 1 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/authentication.rst
@@ -39,7 +39,7 @@
   .. literalinclude:: authentication/setup.py
    :language: python
    :emphasize-lines: 5-6
    :emphasize-lines: 7
    :linenos:
#. We can now install our project in development mode:
docs/quick_tutorial/authentication/development.ini
@@ -6,5 +6,5 @@
tutorial.secret = 98zd
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/authentication/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
    'pyramid_chameleon',
    'bcrypt'
]
docs/quick_tutorial/authorization/development.ini
@@ -6,5 +6,5 @@
tutorial.secret = 98zd
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/authorization/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
    'pyramid_chameleon',
    'bcrypt'
]
docs/quick_tutorial/databases/development.ini
@@ -8,8 +8,8 @@
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
docs/quick_tutorial/databases/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
    'pyramid_chameleon',
    'deform',
    'sqlalchemy',
docs/quick_tutorial/debugtoolbar/development.ini
@@ -4,5 +4,5 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/debugtoolbar/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
]
setup(name='tutorial',
docs/quick_tutorial/forms.rst
@@ -41,7 +41,7 @@
   pulls in Colander as a dependency:
   .. literalinclude:: forms/setup.py
    :emphasize-lines: 5-6
    :emphasize-lines: 7
    :linenos:
#. We can now install our project in development mode:
docs/quick_tutorial/forms/development.ini
@@ -5,5 +5,5 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/forms/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
    'pyramid_chameleon',
    'deform'
]
docs/quick_tutorial/functional_testing/development.ini
@@ -4,5 +4,5 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/functional_testing/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
]
setup(name='tutorial',
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 @@
        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)
docs/quick_tutorial/ini.rst
@@ -89,7 +89,7 @@
- ``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,12 @@
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 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.
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
docs/quick_tutorial/ini/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
]
setup(name='tutorial',
docs/quick_tutorial/jinja2/development.ini
@@ -5,5 +5,5 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/jinja2/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
]
setup(name='tutorial',
docs/quick_tutorial/json/development.ini
@@ -5,5 +5,5 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/json/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
    'pyramid_chameleon'
]
docs/quick_tutorial/logging/development.ini
@@ -5,8 +5,8 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
# Begin logging configuration
docs/quick_tutorial/logging/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
    'pyramid_chameleon'
]
docs/quick_tutorial/more_view_classes/development.ini
@@ -5,5 +5,5 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/more_view_classes/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
    'pyramid_chameleon'
]
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 @@
        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)
docs/quick_tutorial/request_response/development.ini
@@ -5,5 +5,5 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/request_response/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
]
setup(name='tutorial',
docs/quick_tutorial/requirements.rst
@@ -189,17 +189,18 @@
---------------
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::
    # 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`` package.
You can optionally install some of the extra Python packages used in this
tutorial.
docs/quick_tutorial/retail_forms/development.ini
@@ -5,5 +5,5 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/retail_forms/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
    'pyramid_chameleon',
    'deform'
]
docs/quick_tutorial/routing/development.ini
@@ -5,5 +5,5 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/routing/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
    'pyramid_chameleon'
]
docs/quick_tutorial/sessions/development.ini
@@ -5,5 +5,5 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/sessions/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
    'pyramid_chameleon'
]
docs/quick_tutorial/static_assets/development.ini
@@ -5,5 +5,5 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/static_assets/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
    'pyramid_chameleon'
]
docs/quick_tutorial/templating/development.ini
@@ -5,5 +5,5 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/templating/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
    'pyramid_chameleon',
]
docs/quick_tutorial/unit_testing/development.ini
@@ -4,5 +4,5 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/unit_testing/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
]
setup(name='tutorial',
docs/quick_tutorial/view_classes/development.ini
@@ -5,5 +5,5 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/view_classes/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
    'pyramid_chameleon'
]
docs/quick_tutorial/views/development.ini
@@ -4,5 +4,5 @@
    pyramid_debugtoolbar
[server:main]
use = egg:pyramid#wsgiref
port = 6543
use = egg:waitress#main
listen = localhost:6543
docs/quick_tutorial/views/setup.py
@@ -2,6 +2,7 @@
requires = [
    'pyramid',
    'waitress',
]
setup(name='tutorial',