Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

web.py on Google App Engine

I'm trying to get a web.py application running on GAE. I hoped that sth like the following might work

import web
from google.appengine.ext.webapp.util import run_wsgi_app

[...]

def main():
    app = web.application(urls, globals())
    run_wsgi_app(app)

But obviously the app object doesn't conform with the run_wsgi_app function's expectations. The error msg says sth like app has no __call__ function, so I tried passing app.run instead, but that didn't work either.

How can I make the call to run_wsgi_app work?

like image 761
Johannes Charra Avatar asked Sep 08 '10 06:09

Johannes Charra


1 Answers

Here is a snippet of StackPrinter, a webpy application that runs on top of Google App Engine.

from google.appengine.ext.webapp.util import run_wsgi_app
import web
...
app = web.application(urls, globals())

def main():

    application = app.wsgifunc()
    run_wsgi_app(application)

if __name__ == '__main__':
    main()
like image 63
systempuntoout Avatar answered Sep 29 '22 02:09

systempuntoout