2010/12/12 Alessandro <[email protected]>:
> Hi all,
> is there any way to expose a simple "wsgi" application under webpy?
>
> For example:
>
> urls = (
> '/url', 'Wsgiapp',
> )
>
> def iwantexposethis(environ, start_response):
> start_response("200 OK", [])
> return "<html><body>Hi All!</body></html>"
>
> class Wsgiapp(object):
> def GET(self):
> # whihch function could be "XXX" ?
> return XXX(iwantexposethis)
>
> app = web.application(urls, globals())
>
>
> I can be usefull in order to expose third parts wsgi modules.
Here is what you need:
def webpy_wsgi(app):
def start_response(status, headers):
web.ctx.status = status
web.ctx.headers = headers
return app(web.ctx.env, start_response)
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.