如何将 OAuth2Decorator 与 Google Cloud Storage 结合使用?
我按照此说明连接我的应用引擎 python Web 服务与 Google 存储,特别是能够使用文件 API。我浏览了嗡嗡声示例,但似乎对我不起作用。我需要 Web 服务在后台进行授权,以便能够从存储中检索我的文件。
我正在尝试使用装饰器来传递我的 client_id 和 client_secret 但这个过程对我来说不太清楚。有人可以提供一个例子或详细说明一下这个过程吗?
编辑:我正在使用 python 2.7 运行时。
I am following this instructions in order to connect my app engine python web service with Google storage and specifically to be able to use files API. I went through the buzz example but doesn't seem to work for me. I need the web service to authorize in the background in order to be able to retrieve my files from storage.
I am trying to use the decorator in order to pass my client_id and client_secret but the process is not quite clear to me. Someone who can provide an example or elaborate a bit in the process?
edit: I am using python 2.7 runtime.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这可能不是最直接的答案,但您是否探索过 App Engine 上内置的 Google Storage API?
http://code.google.com/appengine/docs/python/googlestorage/
这可以让您绕过本机 API。
This may not be the most direct answer, but have you explored the built in Google Storage API on App Engine?
http://code.google.com/appengine/docs/python/googlestorage/
This lets you bypass the native API all together.
我设法通过使用 au-to- 中的 gslite.py 脚本使其正常运行使用我的凭据执行 google appengine 项目。
I managed to get it running properly by using the gslite.py script from the au-to-do google appengine project with my credentials.
如果您将 apiclient 与本机 REST API 一起使用,它会看起来像这样...
查看其他 API 的一些 apiclient 示例可能会有所帮助。例如,有一个很好的示例,展示了 App Engine 与同样使用 OAuth2 的 Tasks API 的集成。
http://code.google.com/appengine/articles/python/getting_started_with_tasks_api.html
If you are using the apiclient along with the native REST API, it would look something like this...
It might help to look at some of the apiclient examples for other APIs. For example, there's a nice example of an App Engine integration with the Tasks API that also uses OAuth2.
http://code.google.com/appengine/articles/python/getting_started_with_tasks_api.html