简体   繁体   English

带有web.py和Google App Engine的空白页

[英]Blank Page with web.py and Google App Engine

I'm trying to get web.py app running on local Google App Engine. 我正在尝试在本地Google App Engine上运行web.py应用程序。

My yaml: 我的Yaml:

application: appname
version: 1
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /.*
  script: code.app

My code.py: 我的code.py:

import web

urls = (
    "/.*", "hello",
)

app = web.application(urls, globals())

class hello:
    def GET(self):
        return 'Hello, world!'

app = app.gaerun()

When I start the server all I get is a blank page. 当我启动服务器时,我得到的只是一个空白页。 So what's wrong? 那怎么了

Edit: 编辑:

python --version
Python 2.7.6

Edit 2: 编辑2:

Error from console: 控制台错误:

ImportError: No module named web

What you're trying to do is import an external module, which is not supported by GAE. 您要执行的操作是导入外部模块,GAE不支持该模块。

What you can do though, is copy web.py into your app directory, and then use it. 但是,您可以做的是将web.py复制到您的应用程序目录中,然后使用它。 See "How to include third party Python libraries in Google App Engine" . 请参阅“如何在Google App Engine中包括第三方Python库”

You can get the source code from here 您可以从这里获取源代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM