我只是从给定的URL获取内容的简单应用程序在本地服务器上正常工作,但在部署时出错。 Check here
该应用程序只包含两个文件,我在这里包含
compare-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)
的app.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
现在,我完全不知道为什么这不起作用。任何建议或帮助都至关重要。
谢谢!