1

我的简单应用程序仅从给定 URL 获取内容在本地服务器上运行良好,但在部署时会出错。在这里检查

该应用程序仅包含我在此处包含的两个文件

比较-hatke.py

from google.appengine.api import urlfetch

url = "http://www.google.com/"
result = urlfetch.fetch(url)
if result.status_code == 200:
  print(result.content)

应用程序.yaml

application: compare-hatke
version: 3
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /.*
  script: compare-hatke.app

日志 - 版本 1

Traceback (most recent call last):
  File "/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 196, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 269, in _LoadHandler
    raise ImportError('%s has no attribute %s' % (handler, name))
ImportError: <module 'compare-hatke' from '/base/data/home/apps/s~compare-hatke/1.365150810067162164/compare-hatke.pyc'> has no attribute app

现在,我完全不知道为什么这不起作用。任何建议或帮助都是至关重要的。

谢谢 !

4

0 回答 0