2

我無法讓快速啓動正常工作。我是Python和GAE的新手,我不是全職程序員,但之前已經開發過。然而,我已經正確安裝了Python 2.7和GAE(win7),但是快速入門不會告訴我在我的應用程序目錄中放置生成的「session.secret」文件的位置。我把它放在應用程序根目錄「mirror-quickstart-python」文件夾中。當我嘗試通過GAE啓動器在開發者網絡服務器上運行應用程序時,它會引發錯誤(日誌如下所示)。谷歌玻璃蟒蛇快速啓動

我已經成功部署了另一個示例應用程序(留言簿),在這裏:http://smlqadtest.appspot.com/所以我認爲我很接近。爲了在Python中實現這一點,我必須瞭解Jinja2,pip,distribute_setup.py和其他一些東西。它看起來也需要PIL,但是在Win64上似乎有問題讓女巫陷入了一片空洞。但我不確定我需要那個。無論如何,我希望得到這個幫助!謝謝!斯科特

=========GAE Launcher Log Console Output=========== 

2013-07-07 22:47:50 Running command: "['C:\\Python27\\python.exe', 'C:\\Program Files (x86)\\Google\\google_appengine\\dev_appserver.py'​, '--skip_sdk_update_check=yes', '--port=9080', '--admin_port=8001', 'C:\\Users\\sml\\Documents\\GitHub\\mirror-quickst​art-python']" 
INFO 2013-07-07 22:47:53,789 devappserver2.py:528] Skipping SDK update check. 
WARNING 2013-07-07 22:47:53,808 api_server.py:314] Could not initialize images API; you are likely missing the Python "PIL" module. 
INFO 2013-07-07 22:47:53,821 api_server.py:138] Starting API server at: http://localhost:61560 
INFO 2013-07-07 22:47:53,825 dispatcher.py:164] Starting server "default" running at: http://localhost:9080 
INFO 2013-07-07 22:47:53,831 admin_server.py:117] Starting admin server at: http://localhost:8001 
INFO 2013-07-08 05:48:09,594 discovery.py:190] URL being requested: https://www.googleapis.com/discovery/v1/apis/mirro​r/v1/rest?userIp=127.0.0.1 

INFO 2013-07-07 22:48:11,641 server.py:593] default: "GET/HTTP/1.1" 302 - 
ERROR 2013-07-08 05:48:11,651 webapp2.py:1528] Property "client_id" is not configured. 

Traceback (most recent call last): 

File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.3\weba​pp2.py", line 1511, in __call__ 

rv = self.handle_exception(request, response, e) 

File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.3\weba​pp2.py", line 1505, in __call__ 

rv = self.router.dispatch(request, response) 

File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.3\weba​pp2.py", line 1253, in default_dispatcher 

return route.handler_adapter(request, response) 

File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.3\weba​pp2.py", line 1077, in __call__ 

return handler.dispatch() 

File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.3\weba​pp2.py", line 547, in dispatch 

return self.handle_exception(e, self.app.debug) 

File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.3\weba​pp2.py", line 545, in dispatch 

return method(*args, **kwargs) 

File "C:\Users\sml\Documents\GitHub\mirror-quickstart-p​ython\oauth\handler.py", line 55, in get 

flow = self.create_oauth_flow() 

File "C:\Users\sml\Documents\GitHub\mirror-quickstart-p​ython\oauth\handler.py", line 42, in create_oauth_flow 

flow = flow_from_clientsecrets('client_secrets.json', scope=SCOPES) 

File "lib\oauth2client\util.py", line 128, in positional_wrapper 

return wrapped(*args, **kwargs) 

File "lib\oauth2client\client.py", line 1343, in flow_from_clientsecrets 

client_type, client_info = clientsecrets.loadfile(filename, cache=cache) 

File "lib\oauth2client\clientsecrets.py", line 145, in loadfile 

return _loadfile(filename) 

File "lib\oauth2client\clientsecrets.py", line 108, in _loadfile 

return _validate_clientsecrets(obj) 

File "lib\oauth2client\clientsecrets.py", line 85, in _validate_clientsecrets 

'Property "%s" is not configured.' % prop_name) 

InvalidClientSecretsError: Property "client_id" is not configured. 

INFO 2013-07-07 22:48:11,673 server.py:593] default: "GET /auth HTTP/1.1" 500 228 
INFO 2013-07-07 22:48:11,786 server.py:593] default: "GET /favicon.ico HTTP/1.1" 404 154 

============================================= 

回答

3

該錯誤消息表明您還沒有設置客戶端ID爲您的項目:

ERROR ... Property "client_id" is not configured. 

編輯client_secrets.json,並與您從API控制檯採取每this step中的值來填充它設置過程。

例如,如果你的API控制檯看起來是這樣的: enter image description here 那麼你client_secrets.json應該是這樣的:

{ 
    "web": { 
    "client_id": "1234.apps.googleusercontent.com", 
    "client_secret": "ITS_A_SECRET_TO_EVERYBODY", 
    "redirect_uris": [ 
    ], 
    "auth_uri": "https://accounts.google.com/o/oauth2/auth", 
    "token_uri": "https://accounts.google.com/o/oauth2/token" 
    } 
} 
+1

感謝,珍妮!我認爲*我這樣做了,但'session.secret'文件也可能位於錯誤的目錄中。我開始了,並開始了,請隨時閱讀我的​​博客文章'beginner tips'here => https://plus.google.com/u/0/110113915393251652573/posts/PSDJUyJNwJE – user2570699