def get_flow(self):
"""
get the class-level-bound flow handler
"""
if self.flow is None:
self.flow = client.flow_from_clientsecrets(
# we keep the creds in a separate file that we don't check in.
'client_secrets.json',
# we want to be able to get a user's name and email
scope=' '.join([
'https://www.googleapis.com/auth/userinfo.email',
'https://www.googleapis.com/auth/userinfo.profile'
]),
# this url-to-codepath binding is set up in ./users/urls.py
redirect_uri=os.getenv('REDIRECT_URIS', '').split(',')[0],
)
return self.flow
评论列表
文章目录