From 09b3c4465e1370966c4765ae261c910e7dd67883 Mon Sep 17 00:00:00 2001 From: Quentin Smith Date: Sun, 9 Aug 2009 18:45:33 -0400 Subject: [PATCH] Show the cherrypy request object on the helloworld page Add kwargs to helloworld for debugging purposes svn path=/package_branches/invirt-web/cherrypy-rebased/; revision=2675 --- code/main.py | 5 ++--- code/templates/helloworld.mako | 14 +++++++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/code/main.py b/code/main.py index b160e63..3579794 100755 --- a/code/main.py +++ b/code/main.py @@ -68,9 +68,8 @@ class InvirtWeb(View): @cherrypy.expose @cherrypy.tools.mako(filename="/helloworld.mako") - def helloworld(self): - return {} - return "Hello world!\nYour request: "+repr(dir(cherrypy.request)) + def helloworld(self, **kwargs): + return {'request': cherrypy.request, 'kwargs': kwargs} helloworld._cp_config['tools.require_login.on'] = False def pathSplit(path): diff --git a/code/templates/helloworld.mako b/code/templates/helloworld.mako index 22111a1..2cbb063 100644 --- a/code/templates/helloworld.mako +++ b/code/templates/helloworld.mako @@ -1,6 +1,18 @@ +<%page expression_filter="h"/> <%inherit file="skeleton.mako" /> -Hello world! +

Hello world!

+ +

kwargs:

+
+${repr(kwargs)}
+
+ +

Your request:

+ +
+${repr(dir(request))}
+
<%def name="title()"> helloworld -- 1.7.9.5