【问题标题】:Blank Page with web.py and Google App Engine带有 web.py 和 Google App Engine 的空白页面
【发布时间】:2014-06-26 22:28:03
【问题描述】:

我正在尝试让 web.py 应用在本地 Google App Engine 上运行。

我的 yaml:

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

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

我的代码.py:

import web

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

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

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

app = app.gaerun()

当我启动服务器时,我得到的只是一个空白页。那怎么了?

编辑:

python --version
Python 2.7.6

编辑2:

来自控制台的错误:

ImportError: No module named web

【问题讨论】:

  • 你必须提供更多信息。很可能你在控制台中遇到了一些错误。你能提供这些吗?
  • @Lipis 请参阅edit2

标签: python google-app-engine web.py


【解决方案1】:

您尝试做的是导入 GAE 不支持的外部模块。

不过,您可以将 web.py 复制到您的应用目录中,然后使用它。见"How to include third party Python libraries in Google App Engine"

您可以从here获取源代码

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-04-09
    • 1970-01-01
    • 2013-03-29
    • 1970-01-01
    • 2014-10-04
    • 2015-07-22
    • 2017-11-17
    • 2017-01-10
    相关资源
    最近更新 更多