summaryrefslogtreecommitdiff
path: root/docs/narr/helloworld.py
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/narr/helloworld.py
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/narr/helloworld.py')
-rw-r--r--docs/narr/helloworld.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/docs/narr/helloworld.py b/docs/narr/helloworld.py
index c01329af9..29ed8e6f2 100644
--- a/docs/narr/helloworld.py
+++ b/docs/narr/helloworld.py
@@ -7,10 +7,9 @@ def hello_world(request):
return Response('Hello %(name)s!' % request.matchdict)
if __name__ == '__main__':
- config = Configurator()
- config.add_route('hello', '/hello/{name}')
- config.add_view(hello_world, route_name='hello')
- app = config.make_wsgi_app()
+ with Configurator() as config:
+ config.add_route('hello', '/hello/{name}')
+ config.add_view(hello_world, route_name='hello')
+ app = config.make_wsgi_app()
server = make_server('0.0.0.0', 8080, app)
server.serve_forever()
-