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

=============================================
4

1 回答 1

3

该错误消息表明您尚未为您的项目设置客户端 ID:

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

编辑并使用您在设置过程中的此步骤client_secrets.json从 API 控制台获取的值填充它。

例如,如果您的 API 控制台如下所示: 在此处输入图像描述 那么您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"
  }
}
于 2013-07-11T01:26:23.660 回答