当我尝试使用社交身份验证应用程序在 twitter 上进行注册时出现此错误:
TypeError at /login/twitter/
issubclass() arg 1 must be a class
有谁知道是什么原因造成的?我复制了社交身份验证文档中的所有强制性内容,但出现此错误。
完整追溯:
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/login/twitter/
Django Version: 1.5
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',
'django.contrib.admin',
'tager_www',
'fbregister',
'captcha',
'django_twilio',
'social_auth')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
115. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django_social_auth-0.7.22-py2.7.egg/social_auth/decorators.py" in wrapper
26. redirect)
File "/usr/local/lib/python2.7/dist-packages/django_social_auth-0.7.22-py2.7.egg/social_auth/backends/__init__.py" in get_backend
935. get_backends(force_load=True)
File "/usr/local/lib/python2.7/dist-packages/django_social_auth-0.7.22- py2.7.egg/social_auth/backends/__init__.py" in get_backends
914. if issubclass(backend, SocialAuthBackend):
Exception Type: TypeError at /login/twitter/
Exception Value: issubclass() arg 1 must be a class
设置.py:
AUTHENTICATION_BACKENDS = (
# 'fbregister.facebook.FacebookBackend',
'tager_www.views.CustomAuthentication',
'django.contrib.auth',
'django.contrib.auth.backends.ModelBackend'
'social_auth.backends.twitter.TwitterBackend',
'social_auth.backends.facebook.FacebookBackend',
'social_auth.backends.google.GoogleOAuthBackend',
'social_auth.backends.google.GoogleOAuth2Backend',
'social_auth.backends.google.GoogleBackend',
'social_auth.backends.yahoo.YahooBackend',
'social_auth.backends.browserid.BrowserIDBackend',
'social_auth.backends.contrib.linkedin.LinkedinBackend',
'social_auth.backends.contrib.disqus.DisqusBackend',
'social_auth.backends.contrib.livejournal.LiveJournalBackend',
'social_auth.backends.contrib.orkut.OrkutBackend',
'social_auth.backends.contrib.foursquare.FoursquareBackend',
'social_auth.backends.contrib.github.GithubBackend',
'social_auth.backends.contrib.vk.VKOAuth2Backend',
'social_auth.backends.contrib.live.LiveBackend',
'social_auth.backends.contrib.skyrock.SkyrockBackend',
'social_auth.backends.contrib.yahoo.YahooOAuthBackend',
'social_auth.backends.contrib.readability.ReadabilityBackend',
'social_auth.backends.contrib.fedora.FedoraBackend',
'social_auth.backends.OpenIDBackend',
'django.contrib.auth.backends.ModelBackend',
)