1

https://developers.google.com/appengine/docs/python/python27/using27

上面的链接要求将 python 文件命名为“main.app”之类的名称,但 Mac OSX Lion 将此类文件视为“经典”Mac 应用程序。我也尝试将 python 文件命名为“main.application”,但仍然在 googleapps 日志中收到相同的错误消息,如下所示,并告诉我它们不是模块“main”。

ERROR    2012-05-29 17:10:35,136 wsgi.py:189]   
Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 187, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())  
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 225, in _LoadHandler
    handler = __import__(path[0])  
ImportError: No module named main  
INFO     2012-05-29 17:10:35,143 dev_appserver.py:2904] "GET / HTTP/1.1" 500 -

我的 app.yaml 文件如下。

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

handlers:
- url: /.*
  script: main.application

libraries:
- name: webapp2
  version: "2.5.1"
- name: django
  version: "1.3"
- name: PIL
  version: latest

我究竟做错了什么?

布赖恩在亚特兰大

4

1 回答 1

4

您没有将文件命名为“main.app”;这是 WSGI 应用程序的名称,它在文件“main.py”中定义app(或者,在您的情况下,application没有任何名称)。app

于 2012-05-29T17:38:15.623 回答