Google App Engine上的web.py [英] web.py on Google App Engine
问题描述
我正在尝试获取在GAE上运行的 web.py
应用程序。我希望像以下这样的工作可能会奏效。
从google.appengine.ext.webapp.util import导入网站
run_wsgi_app
def main():
app = web.application(urls,globals())
run_wsgi_app(app )
但显然应用程序
对象doesn' t符合 run_wsgi_app
函数的期望值。错误消息说,像应用程序没有__call__函数
,所以我尝试传递 app.run
,但是没有'
我怎样才能调用 run_wsgi_app
工作?
以下是 StackPrinter ,一个在Google App Engine上运行的 webpy 应用程序。
from google.appengine.ext.webapp.util import run_wsgi_app
import web
...
app = web.application(网址, globals())
def main():
application = app.wsgifunc()
run_wsgi_app(application)
if __name__ =='__main__':
main()
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?
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()
这篇关于Google App Engine上的web.py的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!