diff options
| author | Chris McDonough <chrism@plope.com> | 2011-12-16 04:54:09 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-12-16 04:54:09 -0500 |
| commit | 10f1b5c35072c5499f3504dc261fb3c67a90c70d (patch) | |
| tree | 65d844890e4333109b92cfeb91c11d639ae43f07 /docs/narr/configuration.rst | |
| parent | 9003a8bba654f98933b98dacac67760cff73e1c5 (diff) | |
| download | pyramid-10f1b5c35072c5499f3504dc261fb3c67a90c70d.tar.gz pyramid-10f1b5c35072c5499f3504dc261fb3c67a90c70d.tar.bz2 pyramid-10f1b5c35072c5499f3504dc261fb3c67a90c70d.zip | |
stamp out paste.httpserver usage
Diffstat (limited to 'docs/narr/configuration.rst')
| -rw-r--r-- | docs/narr/configuration.rst | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/docs/narr/configuration.rst b/docs/narr/configuration.rst index 597d48b09..37122e382 100644 --- a/docs/narr/configuration.rst +++ b/docs/narr/configuration.rst @@ -36,7 +36,7 @@ applications, configured imperatively: .. code-block:: python :linenos: - from paste.httpserver import serve + from wsgiref.simple_server import make_server from pyramid.config import Configurator from pyramid.response import Response @@ -46,8 +46,8 @@ applications, configured imperatively: if __name__ == '__main__': config = Configurator() config.add_view(hello_world) - app = config.make_wsgi_app() - serve(app, host='0.0.0.0') + server = make_server('0.0.0.0', 8080, app) + server.serve_forever() We won't talk much about what this application does yet. Just note that the "configuration' statements take place underneath the ``if __name__ == @@ -105,7 +105,7 @@ in a package and its subpackages. For example: .. code-block:: python :linenos: - from paste.httpserver import serve + from wsgiref.simple_server import make_server from pyramid.response import Response from pyramid.view import view_config @@ -118,7 +118,8 @@ in a package and its subpackages. For example: config = Configurator() config.scan() app = config.make_wsgi_app() - serve(app, host='0.0.0.0') + server = make_server('0.0.0.0', 8080, app) + server.serve_forever() The scanning machinery imports each module and subpackage in a package or module recursively, looking for special attributes attached to objects |
