私はOAuth2Decorator()
と Pytgon を使用していますが、App Engine についてまだ確信が持てない段階にあります。ドキュメントは情報を提供していないか、単にそれに従うことができません。そう:
OAuth2Decorator() はユーザー資格情報を保存しますか?
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)