summaryrefslogtreecommitdiff
path: root/docs/quick_tutorial/hello_world
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2018-03-13 17:19:44 -0400
committerChris McDonough <chrism@plope.com>2018-03-13 17:19:44 -0400
commitbf59bd87ce2d8dc35f9585087623528bb58363a3 (patch)
treeea5cb12fee6e4453bb8e0bf6b943e1451de7cc73 /docs/quick_tutorial/hello_world
parentb2e8884a94d9e869bf29ea55298ad308f16ed420 (diff)
parent47ff29297c65ae2c8da06a5bb2f361f806681ced (diff)
downloadpyramid-bf59bd87ce2d8dc35f9585087623528bb58363a3.tar.gz
pyramid-bf59bd87ce2d8dc35f9585087623528bb58363a3.tar.bz2
pyramid-bf59bd87ce2d8dc35f9585087623528bb58363a3.zip
Merge branch 'master' of github.com:Pylons/pyramid
Diffstat (limited to 'docs/quick_tutorial/hello_world')
-rw-r--r--docs/quick_tutorial/hello_world/app.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/docs/quick_tutorial/hello_world/app.py b/docs/quick_tutorial/hello_world/app.py
index 0a95f9ad3..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
@@ -9,9 +9,8 @@ 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()
- server = make_server('0.0.0.0', 6543, app)
- server.serve_forever()
+ with Configurator() as config:
+ config.add_route('hello', '/')
+ config.add_view(hello_world, route_name='hello')
+ app = config.make_wsgi_app()
+ serve(app, host='0.0.0.0', port=6543)