summaryrefslogtreecommitdiff
path: root/docs/narr/helloworld.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-08-25 02:23:59 -0400
committerChris McDonough <chrism@plope.com>2011-08-25 02:23:59 -0400
commit0e9fe538b53ca62b8e9400f624e25ddd9bb7d07e (patch)
tree32353078e9b85cf43c92a65c530fbf35d36ef59b /docs/narr/helloworld.py
parenta6035f3ccdd770fd463a67e216fa5c6aab9ced5c (diff)
parentd73be153fa9544f453510524f34d55a7602e0896 (diff)
downloadpyramid-0e9fe538b53ca62b8e9400f624e25ddd9bb7d07e.tar.gz
pyramid-0e9fe538b53ca62b8e9400f624e25ddd9bb7d07e.tar.bz2
pyramid-0e9fe538b53ca62b8e9400f624e25ddd9bb7d07e.zip
Merge branch 'djay-master'
Diffstat (limited to 'docs/narr/helloworld.py')
-rw-r--r--docs/narr/helloworld.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/narr/helloworld.py b/docs/narr/helloworld.py
new file mode 100644
index 000000000..92e16efbb
--- /dev/null
+++ b/docs/narr/helloworld.py
@@ -0,0 +1,13 @@
+from paste.httpserver import serve
+from pyramid.configuration import Configurator
+from pyramid.response import Response
+
+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()
+ serve(app, host='0.0.0.0')