2
我正在使用OAuth2Decorator()
和Pytgon我正处于那个阶段,我仍然不确定关于App Engine的一些事情。文档没有提供任何信息,或者我根本无法遵循它。所以:OAuth2Decorator是否存储用户凭证并更新令牌?
OAuth2Decorator()存储用户Crediantials?
OAuth2Decorator()会自动检索新令牌吗?
求索如下例所示:
decorator = OAuth2Decorator(...)
service = build("drive", "v2")
class AppHandler(BaseHandler):
@decorator.oauth_aware
def get(self):
if decorator.has_credentials():
init = service.files().list().execute(decorator.http())
items = init['items']
context = {'data': getitems(items)}
self.render_response('index.html',**context)
else:
url = decorator.authorize_url()
self.redirect(url)