嗨,我正在开发一个Flask应用程序,该应用程序将登录到Google Spreadsheets。我为此使用Pygheets。它将部署到Heroku中。
在本地运行正常。我在行上有这个
import pygsheets
gc = pygsheets.authorize(service_account_file='credentials.json')
然后,我将其推到heroku上。我得到了这些日志:
2018-09-04T07:24:52.290288+00:00 app[web.1]: gc = pygsheets.authorize(service_account_file='credentials.json')
2018-09-04T07:24:52.290290+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/pygsheets/client.py", line 592, in authorize
2018-09-04T07:24:52.290291+00:00 app[web.1]: outh_nonlocal=outh_nonlocal)
2018-09-04T07:24:52.290293+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/pygsheets/client.py", line 549, in get_outh_credentials
2018-09-04T07:24:52.290316+00:00 app[web.1]: raise IOError(2, "Client secret file does not exist.", client_secret_file)
2018-09-04T07:24:52.290318+00:00 app[web.1]: FileNotFoundError: [Errno 2] Client secret file does not exist.: 'client_secret.json'
在我按下它之前得到的是警告。
warning: LF will be replaced by CRLF in credentials.json.
The file will have its original line endings in your working directory.
这是否也意味着我将其重命名为client_secret.json
?因此:
2018-09-04T07:24:52.290318+00:00 app[web.1]: FileNotFoundError: [Errno 2] Client secret file does not exist.: 'client_secret.json'