Skip to content

Commit

Permalink
- Use the waitress WSGI server instead of wsgiref in scaffold…
Browse files Browse the repository at this point in the history
…ing.
  • Loading branch information
mcdonc committed Jan 3, 2012
1 parent 2d7d36c commit 030d106
Show file tree
Hide file tree
Showing 45 changed files with 67 additions and 86 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Expand Up @@ -10,6 +10,8 @@ Features
of the instance. Common use-cases for this would be to get a database
connection for the request or identify the current user.

- Use the ``waitress`` WSGI server instead of ``wsgiref`` in scaffolding.

1.3a3 (2011-12-21)
==================

Expand Down
2 changes: 1 addition & 1 deletion docs/narr/MyProject/development.ini
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/narr/MyProject/production.ini
Expand Up @@ -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

Expand Down
32 changes: 5 additions & 27 deletions docs/narr/project.rst
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/narr/startup.rst
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki/src/authorization/development.ini
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki/src/authorization/production.ini
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/wiki/src/authorization/setup.py
Expand Up @@ -12,6 +12,7 @@
'pyramid_tm',
'pyramid_debugtoolbar',
'ZODB3',
'waitress',
'docutils',
]

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki/src/basiclayout/development.ini
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki/src/basiclayout/production.ini
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/wiki/src/basiclayout/setup.py
Expand Up @@ -12,6 +12,7 @@
'pyramid_tm',
'pyramid_debugtoolbar',
'ZODB3',
'waitress',
]

setup(name='tutorial',
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki/src/models/development.ini
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki/src/models/production.ini
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/wiki/src/models/setup.py
Expand Up @@ -12,6 +12,7 @@
'pyramid_tm',
'pyramid_debugtoolbar',
'ZODB3',
'waitress',
]

setup(name='tutorial',
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki/src/tests/development.ini
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki/src/tests/production.ini
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/wiki/src/tests/setup.py
Expand Up @@ -12,6 +12,7 @@
'pyramid_tm',
'pyramid_debugtoolbar',
'ZODB3',
'waitress',
'docutils',
'WebTest', # add this
]
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki/src/views/development.ini
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki/src/views/production.ini
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/wiki/src/views/setup.py
Expand Up @@ -12,6 +12,7 @@
'pyramid_tm',
'pyramid_debugtoolbar',
'ZODB3',
'waitress',
'docutils',
]

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki2/src/authorization/development.ini
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki2/src/authorization/production.ini
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/wiki2/src/authorization/setup.py
Expand Up @@ -15,6 +15,7 @@
'pyramid_debugtoolbar',
'zope.sqlalchemy',
'docutils',
'waitress',
]

if sys.version_info[:3] < (2,5,0):
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki2/src/basiclayout/development.ini
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki2/src/basiclayout/production.ini
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/wiki2/src/basiclayout/setup.py
Expand Up @@ -14,6 +14,7 @@
'pyramid_tm',
'pyramid_debugtoolbar',
'zope.sqlalchemy',
'waitress',
]

if sys.version_info[:3] < (2,5,0):
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki2/src/models/development.ini
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki2/src/models/production.ini
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/wiki2/src/models/setup.py
Expand Up @@ -14,6 +14,7 @@
'pyramid_tm',
'pyramid_debugtoolbar',
'zope.sqlalchemy',
'waitress',
]

if sys.version_info[:3] < (2,5,0):
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki2/src/tests/development.ini
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki2/src/tests/production.ini
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/wiki2/src/tests/setup.py
Expand Up @@ -14,6 +14,7 @@
'pyramid_tm',
'pyramid_debugtoolbar',
'zope.sqlalchemy',
'waitress',
'docutils',
'WebTest', # add this
]
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki2/src/views/development.ini
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/wiki2/src/views/production.ini
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/wiki2/src/views/setup.py
Expand Up @@ -14,6 +14,7 @@
'pyramid_tm',
'pyramid_debugtoolbar',
'zope.sqlalchemy',
'waitress',
'docutils',
]

Expand Down

0 comments on commit 030d106

Please sign in to comment.