【发布时间】:2014-11-02 06:48:44
【问题描述】:
有没有办法使用 python social auth 获取 Google 个人资料图片网址?
所以,这就是我为 facebook 和 twitter 做的,用这段代码添加一个管道:
if strategy.backend.name == 'facebook':
url = 'http://graph.facebook.com/{0}/picture'.format(response['id'])
elif strategy.backend.name == "twitter":
if response['profile_image_url'] != '':
url = response['profile_image_url']
elif strategy.backend.name == "GoogleOAuth2": # doesn't work
user_id = response['id']
url = "???"
首先,我不知道后端的名称是什么,是“GoogleOAuth2”吗? 其次,我应该使用什么网址来保存个人资料的头像?是这样吗?
【问题讨论】:
标签: python google-plus google-login python-social-auth