From d36b566a83addddb80d221aa042b828268f185f2 Mon Sep 17 00:00:00 2001 From: Dylan Jay Date: Thu, 25 Aug 2011 13:05:52 +1000 Subject: use routes in firstapp as they are more familar to most and put hello world on the front page to make grab framework shoppers attention. --- docs/narr/helloworld.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/narr/helloworld.py (limited to 'docs/narr/helloworld.py') diff --git a/docs/narr/helloworld.py b/docs/narr/helloworld.py new file mode 100644 index 000000000..23bb146df --- /dev/null +++ b/docs/narr/helloworld.py @@ -0,0 +1,12 @@ +from paste.httpserver import serve +from pyramid.configuration import Configurator + +def hello_world(request): + return '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') \ No newline at end of file -- cgit v1.2.3