【发布时间】:2021-02-26 20:56:00
【问题描述】:
我有一个本地烧瓶应用程序正在从 csv 文件中读取数据。使用下面的代码,我能够成功地从名为“Vocab”的电子表格的第一列和第二列中读取数据。 “service_account.json”当前与我的其他应用程序文件一起保存在我的本地工作目录中。
gc = gspread.service_account(filename='service_account.json')
sh = gc.open("Vocab")
worksheetOne = sh.sheet1
self.columnOne = [str(i) for i in worksheetOne.col_values(1)]
self.columnTwo = [str(i) for i in worksheetOne.col_values(2)]
我现在正在尝试将此烧瓶应用程序部署到谷歌应用程序引擎,但我不确定如何替换我用于凭据的本地“service_account.json”文件,以便能够访问我的谷歌表信息。从我的谷歌应用程序访问我的谷歌表格信息的最佳方式是什么?
【问题讨论】:
-
您可以在您的应用中部署
service_account.json并以同样的方式进行操作吗? -
是的,我可以!轻松修复
标签: python google-app-engine flask google-sheets