Google App Engine上的web.py [英] web.py on Google App Engine

查看:122
本文介绍了Google App Engine上的web.py的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆