2015-02-07 106 views
-1

我看了一下app engine python tutorial error這個問題。它不回答我的問題,所以這不是一個重複的問題:)Google App引擎出現問題Python教程

我遵循Google App Engine Python教程。當我嘗試運行第4部分「使用用戶服務」中的示例時,我遇到了麻煩。當我按照說明我得到這個錯誤:

2015-02-06 17:56:22 Running command: "['C:\\Python27\\pythonw.exe', 'C:\\Program Files (x86)\\Google\\google_appengine\\dev_appserver.py', '--skip_sdk_update_check=yes', '--port=8080', '--admin_port=8000', 'C:\\Users\\plankton\\google_app_eng\\helloworld\\helloworld']" 
INFO  2015-02-06 17:56:26,164 devappserver2.py:745] Skipping SDK update check. 
INFO  2015-02-06 17:56:26,203 api_server.py:172] Starting API server at: http://localhost:52731 
INFO  2015-02-06 17:56:26,210 dispatcher.py:186] Starting module "default" running at: http://localhost:8080 
INFO  2015-02-06 17:56:26,213 admin_server.py:118] Starting admin server at: http://localhost:8000 
ERROR 2015-02-07 01:57:04,624 wsgi.py:263] 

Traceback (most recent call last): 

    File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 240, in Handle 

    handler = _config_handle.add_wsgi_middleware(self._LoadHandler()) 

    File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 302, in _LoadHandler 

    raise err 

ImportError: <module 'main' from 'C:\Users\plankton\google_app_eng\helloworld\helloworld\main.pyc'> has no attribute app 

INFO  2015-02-06 17:57:04,651 module.py:718] default: "GET/HTTP/1.1" 500 - 

這裏是,我有麻煩的教程部分鏈接:Using the Users Service 有任何人能幫助我嗎?

謝謝!

更新:謝謝亞歷克斯!我想我明白你的觀點。

$ diff main.py main.py.500err 
44c44 
< app = webapp2.WSGIApplication([ 
--- 
> application = webapp2.WSGIApplication([ 

回答

0

我說謊了。我沒有完全按照教程!當我從教程的第一部分創建我的helloworld時,我使用「Google App Engine啓動器」創建項目,而不是通過啓動器從外部創建文件,並通過選擇File menu, Add Existing Application...創建項目,然後選擇helloworld

0

不管你做了什麼,你的main.py確實是而不是有一個全局對象名爲app,因爲它應該有你跟着教程。

,你能否告訴我們的部分你main.py以爲會使一個全局對象(一WSGI應用程序)稱爲app?然後我們可以試着幫助解釋爲什麼那部分沒有。還是你只是完全忽略不那麼微小的方面 - ?)

如果您app.yamlhandlers:節說,隨後main.appscript:,這意味着這些網址將由WSGI應用對象來處理所謂app,建造和安置在您的main.py(這與python27值爲runtime:,我敢打賭,你正在使用)。

如果您告訴系統(通過app.yaml中的條目)在main中查找名稱app,並且在那裏沒有這樣的全局名稱,請猜測您得到了什麼...?

A-燁,正是錯誤消息<module 'main' from [snip] > has no attribute app - 因爲你的 「模塊main」,你猜怎麼着!,有沒有屬性app!那麼怎樣解決這個問題,錯誤信息是如此完全清楚的? - )