Changeset 2407


Ignore:
Timestamp:
Aug 9, 2009, 6:45:33 PM (15 years ago)
Author:
quentin
Message:

Show the cherrypy request object on the helloworld page

Location:
package_branches/invirt-web/cherrypy/code
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • package_branches/invirt-web/cherrypy/code/main.py

    r2403 r2407  
    7070    @cherrypy.tools.mako(filename="/helloworld.mako")
    7171    def helloworld(self):
    72         return {}
    73         return "Hello world!\nYour request: "+repr(dir(cherrypy.request))
     72        return {'request': cherrypy.request}
    7473    helloworld._cp_config['tools.require_login.on'] = False
    7574
  • package_branches/invirt-web/cherrypy/code/templates/helloworld.mako

    r2392 r2407  
     1<%page expression_filter="h"/>
    12<%inherit file="skeleton.mako" />
    23
    3 Hello world!
     4<p>Hello world!</p>
     5
     6<p>Your request:</p>
     7
     8<pre style="white-space: pre-wrap">
     9${repr(dir(request))}
     10</pre>
    411
    512<%def name="title()">
Note: See TracChangeset for help on using the changeset viewer.