diff options
Diffstat (limited to 'docs')
35 files changed, 52 insertions, 79 deletions
diff --git a/docs/narr/MyProject/development.ini b/docs/narr/MyProject/development.ini index d61da580f..2ccedb27b 100644 --- a/docs/narr/MyProject/development.ini +++ b/docs/narr/MyProject/development.ini @@ -10,7 +10,7 @@ pyramid.default_locale_name = en pyramid.includes = pyramid_debugtoolbar [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/narr/MyProject/production.ini b/docs/narr/MyProject/production.ini index 97050e8fe..43ea1d140 100644 --- a/docs/narr/MyProject/production.ini +++ b/docs/narr/MyProject/production.ini @@ -9,7 +9,7 @@ pyramid.debug_templates = false pyramid.default_locale_name = en [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/narr/project.rst b/docs/narr/project.rst index 0c12d97e6..896b65249 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -888,33 +888,11 @@ Using an Alternate WSGI Server The code generated by :app:`Pyramid` scaffolding assumes that you will be using the ``pserve`` command to start your application while you do -development. The default rendering of Pyramid scaffolding uses the *wsgiref* -WSGI server, which is a server that is ill-suited for production usage: its -main feature is that it works on all platforms and all systems, making it a -good choice as a default server from the perspective of Pyramid's developers. - -To use a server more suitable for production, you have a number of choices. -Replace the ``use = egg:pyramid#wsgref`` line in your ``production.ini`` with -one of the following. - -``use = egg:Paste#http`` - - ``paste.httpserver`` is Windows, UNIX, and Python 2 compatible. You'll - need to ``easy_install Paste`` into your Pyramid virtualenv for this server - to work. - -``use = egg:pyramid#cherrypy`` - - The ``CherryPy`` WSGI server is Windows, UNIX, Python 2, and Python 3 - compatible. You'll need to ``easy_install CherryPy`` into your Pyramid - virtualenv for this server to work. - -The servers described above are typically both faster and more secure than -the default WSGI server used by Pyramid. Pyramid does not depend on either -because Paste doesn't run on Python 3 (and Pyramid must) and the CherryPy -server is not distributed separately from the CherryPy web framework (and it -would be an awkward dependency to have a web framework rely on another web -framework for just its server component). +development. The default rendering of Pyramid scaffolding uses the +*waitress* WSGI server, which is a server that is suited for production +usage. It's not very fast, or very featureful: its main feature is that it +works on all platforms and all systems, making it a good choice as a default +server from the perspective of Pyramid's developers. ``pserve`` is by no means the only way to start up and serve a :app:`Pyramid` application. As we saw in :ref:`firstapp_chapter`, ``pserve`` needn't be diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index a7fc5d33c..78b119687 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -133,8 +133,8 @@ Here's a high-level time-ordered overview of what happens when you press far as ``pserve`` is concerned, it is "just another WSGI application". #. ``pserve`` starts the WSGI *server* defined within the ``[server:main]`` - section. In our case, this is the ``egg:pyramid#wsgiref`` server (``use = - egg:pyramid#wsgiref``), and it will listen on all interfaces (``host = + section. In our case, this is the Waitress server (``use = + egg:waitress#main``), and it will listen on all interfaces (``host = 0.0.0.0``), on port number 6543 (``port = 6543``). The server code itself is what prints ``serving on 0.0.0.0:6543 view at http://127.0.0.1:6543``. The server serves the application, and the application is running, waiting diff --git a/docs/tutorials/wiki/src/authorization/development.ini b/docs/tutorials/wiki/src/authorization/development.ini index 0f950e260..47566515c 100644 --- a/docs/tutorials/wiki/src/authorization/development.ini +++ b/docs/tutorials/wiki/src/authorization/development.ini @@ -13,7 +13,7 @@ tm.attempts = 3 zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000 [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki/src/authorization/production.ini b/docs/tutorials/wiki/src/authorization/production.ini index f632f89d1..919efce1e 100644 --- a/docs/tutorials/wiki/src/authorization/production.ini +++ b/docs/tutorials/wiki/src/authorization/production.ini @@ -12,7 +12,7 @@ tm.attempts = 3 zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000 [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki/src/authorization/setup.py b/docs/tutorials/wiki/src/authorization/setup.py index 284bc216e..31c51dbcf 100644 --- a/docs/tutorials/wiki/src/authorization/setup.py +++ b/docs/tutorials/wiki/src/authorization/setup.py @@ -12,6 +12,7 @@ requires = [ 'pyramid_tm', 'pyramid_debugtoolbar', 'ZODB3', + 'waitress', 'docutils', ] diff --git a/docs/tutorials/wiki/src/basiclayout/development.ini b/docs/tutorials/wiki/src/basiclayout/development.ini index e296ea1a1..3acff7f6d 100644 --- a/docs/tutorials/wiki/src/basiclayout/development.ini +++ b/docs/tutorials/wiki/src/basiclayout/development.ini @@ -13,7 +13,7 @@ tm.attempts = 3 zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000 [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki/src/basiclayout/production.ini b/docs/tutorials/wiki/src/basiclayout/production.ini index f632f89d1..919efce1e 100644 --- a/docs/tutorials/wiki/src/basiclayout/production.ini +++ b/docs/tutorials/wiki/src/basiclayout/production.ini @@ -12,7 +12,7 @@ tm.attempts = 3 zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000 [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki/src/basiclayout/setup.py b/docs/tutorials/wiki/src/basiclayout/setup.py index d5fd8891f..43600e239 100644 --- a/docs/tutorials/wiki/src/basiclayout/setup.py +++ b/docs/tutorials/wiki/src/basiclayout/setup.py @@ -12,6 +12,7 @@ requires = [ 'pyramid_tm', 'pyramid_debugtoolbar', 'ZODB3', + 'waitress', ] setup(name='tutorial', diff --git a/docs/tutorials/wiki/src/models/development.ini b/docs/tutorials/wiki/src/models/development.ini index 0f950e260..47566515c 100644 --- a/docs/tutorials/wiki/src/models/development.ini +++ b/docs/tutorials/wiki/src/models/development.ini @@ -13,7 +13,7 @@ tm.attempts = 3 zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000 [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki/src/models/production.ini b/docs/tutorials/wiki/src/models/production.ini index f632f89d1..919efce1e 100644 --- a/docs/tutorials/wiki/src/models/production.ini +++ b/docs/tutorials/wiki/src/models/production.ini @@ -12,7 +12,7 @@ tm.attempts = 3 zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000 [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki/src/models/setup.py b/docs/tutorials/wiki/src/models/setup.py index d5fd8891f..43600e239 100644 --- a/docs/tutorials/wiki/src/models/setup.py +++ b/docs/tutorials/wiki/src/models/setup.py @@ -12,6 +12,7 @@ requires = [ 'pyramid_tm', 'pyramid_debugtoolbar', 'ZODB3', + 'waitress', ] setup(name='tutorial', diff --git a/docs/tutorials/wiki/src/tests/development.ini b/docs/tutorials/wiki/src/tests/development.ini index 0f950e260..47566515c 100644 --- a/docs/tutorials/wiki/src/tests/development.ini +++ b/docs/tutorials/wiki/src/tests/development.ini @@ -13,7 +13,7 @@ tm.attempts = 3 zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000 [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki/src/tests/production.ini b/docs/tutorials/wiki/src/tests/production.ini index f632f89d1..919efce1e 100644 --- a/docs/tutorials/wiki/src/tests/production.ini +++ b/docs/tutorials/wiki/src/tests/production.ini @@ -12,7 +12,7 @@ tm.attempts = 3 zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000 [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki/src/tests/setup.py b/docs/tutorials/wiki/src/tests/setup.py index dfecb7c5c..a7ad7317c 100644 --- a/docs/tutorials/wiki/src/tests/setup.py +++ b/docs/tutorials/wiki/src/tests/setup.py @@ -12,6 +12,7 @@ requires = [ 'pyramid_tm', 'pyramid_debugtoolbar', 'ZODB3', + 'waitress', 'docutils', 'WebTest', # add this ] diff --git a/docs/tutorials/wiki/src/views/development.ini b/docs/tutorials/wiki/src/views/development.ini index e296ea1a1..3acff7f6d 100644 --- a/docs/tutorials/wiki/src/views/development.ini +++ b/docs/tutorials/wiki/src/views/development.ini @@ -13,7 +13,7 @@ tm.attempts = 3 zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000 [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki/src/views/production.ini b/docs/tutorials/wiki/src/views/production.ini index f632f89d1..919efce1e 100644 --- a/docs/tutorials/wiki/src/views/production.ini +++ b/docs/tutorials/wiki/src/views/production.ini @@ -12,7 +12,7 @@ tm.attempts = 3 zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000 [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki/src/views/setup.py b/docs/tutorials/wiki/src/views/setup.py index 866f12bef..a6be89b2e 100644 --- a/docs/tutorials/wiki/src/views/setup.py +++ b/docs/tutorials/wiki/src/views/setup.py @@ -12,6 +12,7 @@ requires = [ 'pyramid_tm', 'pyramid_debugtoolbar', 'ZODB3', + 'waitress', 'docutils', ] diff --git a/docs/tutorials/wiki2/src/authorization/development.ini b/docs/tutorials/wiki2/src/authorization/development.ini index 4f7493cba..2bb74454c 100644 --- a/docs/tutorials/wiki2/src/authorization/development.ini +++ b/docs/tutorials/wiki2/src/authorization/development.ini @@ -13,7 +13,7 @@ pyramid.includes = pyramid_debugtoolbar sqlalchemy.url = sqlite:///%(here)s/tutorial.db [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki2/src/authorization/production.ini b/docs/tutorials/wiki2/src/authorization/production.ini index 53eaf20a1..ec6dea135 100644 --- a/docs/tutorials/wiki2/src/authorization/production.ini +++ b/docs/tutorials/wiki2/src/authorization/production.ini @@ -12,7 +12,7 @@ pyramid.includes = pyramid_tm sqlalchemy.url = sqlite:///%(here)s/tutorial.db [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki2/src/authorization/setup.py b/docs/tutorials/wiki2/src/authorization/setup.py index 09769bfff..7f1ae10b1 100644 --- a/docs/tutorials/wiki2/src/authorization/setup.py +++ b/docs/tutorials/wiki2/src/authorization/setup.py @@ -15,6 +15,7 @@ requires = [ 'pyramid_debugtoolbar', 'zope.sqlalchemy', 'docutils', + 'waitress', ] if sys.version_info[:3] < (2,5,0): diff --git a/docs/tutorials/wiki2/src/basiclayout/development.ini b/docs/tutorials/wiki2/src/basiclayout/development.ini index 4f7493cba..2bb74454c 100644 --- a/docs/tutorials/wiki2/src/basiclayout/development.ini +++ b/docs/tutorials/wiki2/src/basiclayout/development.ini @@ -13,7 +13,7 @@ pyramid.includes = pyramid_debugtoolbar sqlalchemy.url = sqlite:///%(here)s/tutorial.db [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki2/src/basiclayout/production.ini b/docs/tutorials/wiki2/src/basiclayout/production.ini index 53eaf20a1..ec6dea135 100644 --- a/docs/tutorials/wiki2/src/basiclayout/production.ini +++ b/docs/tutorials/wiki2/src/basiclayout/production.ini @@ -12,7 +12,7 @@ pyramid.includes = pyramid_tm sqlalchemy.url = sqlite:///%(here)s/tutorial.db [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki2/src/basiclayout/setup.py b/docs/tutorials/wiki2/src/basiclayout/setup.py index 0ca918cab..44796d4ad 100644 --- a/docs/tutorials/wiki2/src/basiclayout/setup.py +++ b/docs/tutorials/wiki2/src/basiclayout/setup.py @@ -14,6 +14,7 @@ requires = [ 'pyramid_tm', 'pyramid_debugtoolbar', 'zope.sqlalchemy', + 'waitress', ] if sys.version_info[:3] < (2,5,0): diff --git a/docs/tutorials/wiki2/src/models/development.ini b/docs/tutorials/wiki2/src/models/development.ini index 4f7493cba..2bb74454c 100644 --- a/docs/tutorials/wiki2/src/models/development.ini +++ b/docs/tutorials/wiki2/src/models/development.ini @@ -13,7 +13,7 @@ pyramid.includes = pyramid_debugtoolbar sqlalchemy.url = sqlite:///%(here)s/tutorial.db [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki2/src/models/production.ini b/docs/tutorials/wiki2/src/models/production.ini index 53eaf20a1..ec6dea135 100644 --- a/docs/tutorials/wiki2/src/models/production.ini +++ b/docs/tutorials/wiki2/src/models/production.ini @@ -12,7 +12,7 @@ pyramid.includes = pyramid_tm sqlalchemy.url = sqlite:///%(here)s/tutorial.db [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki2/src/models/setup.py b/docs/tutorials/wiki2/src/models/setup.py index 0ca918cab..44796d4ad 100644 --- a/docs/tutorials/wiki2/src/models/setup.py +++ b/docs/tutorials/wiki2/src/models/setup.py @@ -14,6 +14,7 @@ requires = [ 'pyramid_tm', 'pyramid_debugtoolbar', 'zope.sqlalchemy', + 'waitress', ] if sys.version_info[:3] < (2,5,0): diff --git a/docs/tutorials/wiki2/src/tests/development.ini b/docs/tutorials/wiki2/src/tests/development.ini index 4f7493cba..2bb74454c 100644 --- a/docs/tutorials/wiki2/src/tests/development.ini +++ b/docs/tutorials/wiki2/src/tests/development.ini @@ -13,7 +13,7 @@ pyramid.includes = pyramid_debugtoolbar sqlalchemy.url = sqlite:///%(here)s/tutorial.db [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki2/src/tests/production.ini b/docs/tutorials/wiki2/src/tests/production.ini index 53eaf20a1..ec6dea135 100644 --- a/docs/tutorials/wiki2/src/tests/production.ini +++ b/docs/tutorials/wiki2/src/tests/production.ini @@ -12,7 +12,7 @@ pyramid.includes = pyramid_tm sqlalchemy.url = sqlite:///%(here)s/tutorial.db [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki2/src/tests/setup.py b/docs/tutorials/wiki2/src/tests/setup.py index f965ccc6e..d8be7539b 100644 --- a/docs/tutorials/wiki2/src/tests/setup.py +++ b/docs/tutorials/wiki2/src/tests/setup.py @@ -14,6 +14,7 @@ requires = [ 'pyramid_tm', 'pyramid_debugtoolbar', 'zope.sqlalchemy', + 'waitress', 'docutils', 'WebTest', # add this ] diff --git a/docs/tutorials/wiki2/src/views/development.ini b/docs/tutorials/wiki2/src/views/development.ini index 4f7493cba..2bb74454c 100644 --- a/docs/tutorials/wiki2/src/views/development.ini +++ b/docs/tutorials/wiki2/src/views/development.ini @@ -13,7 +13,7 @@ pyramid.includes = pyramid_debugtoolbar sqlalchemy.url = sqlite:///%(here)s/tutorial.db [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki2/src/views/production.ini b/docs/tutorials/wiki2/src/views/production.ini index 53eaf20a1..ec6dea135 100644 --- a/docs/tutorials/wiki2/src/views/production.ini +++ b/docs/tutorials/wiki2/src/views/production.ini @@ -12,7 +12,7 @@ pyramid.includes = pyramid_tm sqlalchemy.url = sqlite:///%(here)s/tutorial.db [server:main] -use = egg:pyramid#wsgiref +use = egg:waitress#main host = 0.0.0.0 port = 6543 diff --git a/docs/tutorials/wiki2/src/views/setup.py b/docs/tutorials/wiki2/src/views/setup.py index 9c0e88eb0..05c7be2d7 100644 --- a/docs/tutorials/wiki2/src/views/setup.py +++ b/docs/tutorials/wiki2/src/views/setup.py @@ -14,6 +14,7 @@ requires = [ 'pyramid_tm', 'pyramid_debugtoolbar', 'zope.sqlalchemy', + 'waitress', 'docutils', ] diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index acbaa1335..e8d549e60 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -52,7 +52,7 @@ to make some changes: - We've replaced the ``paster`` command with Pyramid-specific analogues. -- We've made the default WSGI server the ``wsgiref`` server. +- We've made the default WSGI server the ``waitress`` server. Previously (in Pyramid 1.0, 1.1 and 1.2), you created a Pyramid application using ``paster create``, like so:: @@ -85,37 +85,25 @@ Analogues of ``paster pshell``, ``paster pviews``, ``paster request`` and ``paster ptweens`` also exist under the respective console script names ``pshell``, ``pviews``, ``prequest`` and ``ptweens``. -We've replaced use of the Paste ``httpserver`` with the ``wsgiref`` server in +We've replaced use of the Paste ``httpserver`` with the ``waitress`` server in the scaffolds, so once you create a project from a scaffold, its ``development.ini`` and ``production.ini`` will have the following line:: - use = egg:pyramid#wsgiref + use = egg:waitress#main Instead of this (which was the default in older versions):: use = egg:Paste#http -Using ``wsgiref`` as the default WSGI server is purely a default to make it -possible to use the same scaffolding under Python 2 and Python 3; people -running Pyramid under Python 2 can still manually install ``Paste`` and use -the Paste ``httpserver`` by replacing the former line with the latter. This is -actually recommended if you rely on proxying from Apache or Nginx to a -``pserve`` -invoked application. **The wsgiref server is not a production -quality server.** See :ref:`alternate_wsgi_server` for more information. - -New releases in every older major Pyramid series (1.0.2, 1.1.3, 1.2.5) also -have the ``egg:pyramid#wsgiref`` entry point, so scaffold-writers can depend -on it being there even in older major Pyramid versions. - .. warning:: - Previously, paste.httpserver "helped" by converting header values that weren't - strings to strings. The wsgiref server, on the other hand implements the spec - more fully. This specifically may affect you if you are modifying headers on - your response. The following error might be an indicator of this problem: - **AssertionError: Header values must be strings, please check the type of - the header being returned.** A common case would be returning unicode headers - instead of string headers. + Previously, paste.httpserver "helped" by converting header values that + weren't strings to strings. The ``waitress`` server, on the other hand + implements the spec more fully. This specifically may affect you if you + are modifying headers on your response. The following error might be an + indicator of this problem: **AssertionError: Header values must be + strings, please check the type of the header being returned.** A common + case would be returning unicode headers instead of string headers. A new :mod:`pyramid.compat` module was added which provides Python 2/3 straddling support for Pyramid add-ons and development environments. @@ -264,12 +252,9 @@ Backwards Incompatibilities Python 3. - The default WSGI server run as the result of ``pserve`` from newly rendered - scaffolding is now the ``wsgiref`` WSGI server instead of the - ``paste.httpserver`` server. ``wsgiref``, unlike the server it replaced - (``paste.httpserver``) is not a production quality server. See - :ref:`alternate_wsgi_server` for information about how to use another WSGI - server in production. Rationale: the Paste and PasteScript packages do not - run under Python 3. + scaffolding is now the ``waitress`` WSGI server instead of the + ``paste.httpserver`` server. Rationale: the Paste and PasteScript packages + do not run under Python 3. - The ``pshell`` command (see "paster pshell") no longer accepts a ``--disable-ipython`` command-line argument. Instead, it accepts a ``-p`` |
