嗨,我正在尝试通过 facebook 登录我的网站。我正在使用 django-social-auth 。
我的设置部分是:
FACEBOOK_APP_ID = 'facebook app id here'
FACEBOOK_API_SECERET = 'api secret here'
FACEBOOK_EXTENDED_PERMISSIONS = ['email', 'user_location', 'user_photos']
AUTHENTICATION_BACKENDS = (
'social_auth.backends.facebook.FacebookBackened',
)
LOGIN_URL = '/account/login/'
LOGIN_REDIRECT_URL = '/account/post_login/'
在网址中:
url(r'', include('social_auth.urls'))
在模板中:
<a rel="nofollow" href="{% url 'socialauth_begin' 'facebook' %}">facebook</a>
错误跟踪是这样的:
Request Method: GET
Request URL: http://127.0.0.1:8000/login/facebook/
Django Version: 1.5.1
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'grappelli',
'django.contrib.admin',
'south',
'djrill',
'bootstrapform',
'djcelery',
'djcelery_email',
'social_auth',
'smbhero',
'apps.common',
'apps.account',
'apps.company',
'apps.content')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/mnt/www/smb/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
115. response = callback(request, *callback_args, **callback_kwargs)
File "/mnt/www/smb/local/lib/python2.7/site-packages/social_auth/decorators.py" in wrapper
26. redirect)
File "/mnt/www/smb/local/lib/python2.7/site-packages/social_auth/backends/__init__.py" in get_backend
994. get_backends(force_load=True)
File "/mnt/www/smb/local/lib/python2.7/site-packages/social_auth/backends/__init__.py" in get_backends
971. backend = getattr(module, cls_name)
Exception Type: AttributeError at /login/facebook/
Exception Value: 'module' object has no attribute 'FacebookBackened'
我做错了什么?我应该怎么做才能解决它?