error when trying to use social auth to register with twitter

I had this error when I tried to make the registration with twitter with social auth app:

TypeError at /login/twitter/ 
issubclass() arg 1 must be a class  

Does anybody have any idea what causes this? I copied all the mandatory things in the social auth docs and I'm getting this error.

Full traceback:


Request Method: GET
Request URL:

Django Version: 1.5
Python Version: 2.7.3
Installed Applications:
Installed Middleware:

    File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/" 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/" in wrapper
      26.  redirect)
    File "/usr/local/lib/python2.7/dist-packages/django_social_auth-0.7.22-py2.7.egg/social_auth/backends/" 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/" in get_backends
      914. if issubclass(backend, SocialAuthBackend):

Exception Type: TypeError at /login/twitter/
Exception Value: issubclass() arg 1 must be a class :

# 'fbregister.facebook.FacebookBackend',




Short answer:

You should remove 'django.contrib.auth' from AUTHENTICATION_BACKENDS - it is not a backend, but module.

Explanation of the exception:

There is a code from django-social-auth:

for auth_backend in setting('AUTHENTICATION_BACKENDS'):
    mod, cls_name = auth_backend.rsplit('.', 1)
    module = import_module(mod)
    backend = getattr(module, cls_name)

if issubclass(backend, SocialAuthBackend):
    # ....

With 'django.contrib.auth', backend will become a module, not a class.

Second problem: it's just a typo - you forgot about , after 'django.contrib.auth.backends.ModelBackend'.

Need Your Help

Size of QByteArray is hard to compute?

qt qbytearray

Recently I programmed to do file transmission with Qt. Thought it worked now, I'm still curious about what happened. Please help me find out the reason. Many thanks.

How to change direction of drawing children of grid to Right_To_Left in Android

android gridview android-layout

Im trying to use grid but I need to change direction of inserting children from ( left to right ) to ( right to left ). is there any way to do so , simple example would help me more.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.