使用django allauth时无法获取电子邮件地址。在settings.py中,我包含以下范围
ACCOUNT_USERNAME_REQUIRED = True
ACCOUNT_EMAIL_REQUIRED = True
SOCIALACCOUNT_EMAIL_REQUIRED = False
SOCIALACCOUNT_QUERY_EMAIL = True
SOCIALACCOUNT_PROVIDERS = \
{
'google': {
'SCOPE': ['https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/userinfo.email'],
'AUTH_PARAMS': {'access_type': 'online'}
}
}
我收到除电子邮件之外的所有其他用户详细信息
答案 0 :(得分:1)
SCOPE
应该是['profile', 'email']
,而不是网址
http://django-allauth.readthedocs.org/en/latest/providers.html#django-configuration