我刚刚完成了django-allauth的安装,当我导航到所有社交提供商的模板页面时,我收到了以下消息:
AttributeError at /account/facebook/login/
'tuple' object has no attribute 'get'settings.social_account_providers
SOCIALACCOUNT_PROVIDERS = (
{'facebook':
{'SCOPE': ['email', 'publish_stream'],
'FB_LOGIN': {'auth_type': 'reauthenticate'},
'METHOD': 'js_sdk'}},
{ 'twitter':
{ 'SCOPE': ['r_emailaddress'] } },
{ 'google':
{ 'SCOPE': ['https://www.googleapis.com/auth/userinfo.profile']}},
{ 'linkedin':
{ 'SCOPE': ['r_emailaddress'] }} )
html
<a method="js_sdk" href="{% provider_login_url "Facebook" %}"></a>发布于 2013-02-11 03:42:51
SOCIALACCOUNT_PROVIDERS设置应为字典({...})。我怀疑在您的例子中它是一个元组--我看到您使用的是元组括号。
试试这个:
python manage.py shell
>>> from django.conf import settings
>>> type(settings.SOCIALACCOUNT_PROVIDERS)
<type 'dict'>在你的案例中写的是<type 'dict'>吗?
https://stackoverflow.com/questions/14801160
复制相似问题