Changeset 2675 for package_branches


Ignore:
Timestamp:
Dec 20, 2009, 9:44:37 PM (15 years ago)
Author:
broder
Message:

Show the cherrypy request object on the helloworld page
Add kwargs to helloworld for debugging purposes

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

Legend:

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

    r2674 r2675  
    6969    @cherrypy.expose
    7070    @cherrypy.tools.mako(filename="/helloworld.mako")
    71     def helloworld(self):
    72         return {}
    73         return "Hello world!\nYour request: "+repr(dir(cherrypy.request))
     71    def helloworld(self, **kwargs):
     72        return {'request': cherrypy.request, 'kwargs': kwargs}
    7473    helloworld._cp_config['tools.require_login.on'] = False
    7574
  • package_branches/invirt-web/cherrypy-rebased/code/templates/helloworld.mako

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