I have used django-social-auth
in my project to enable the user to sign in using different social websites like twitter or facebook. For that I have to enable different authentication backends in settings.py
like this:
AUTHENTICATION_BACKENDS = (
'social_auth.backends.twitter.TwitterBackend',
'social_auth.backends.facebook.FacebookBackend',
)
By enabling these backends I can not login to django admin page. Where an occurs saying that username of password not correct for a staff user.
I have disabled these backends then admin page is working but I am not able to achieve the functionality of sign in using different social websites. Please help me out in this problem. All the suggestions will be appreciated.
Add django.contrib.auth.backends.ModelBackend
to this list:
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'social_auth.backends.twitter.TwitterBackend',
'social_auth.backends.facebook.FacebookBackend',
)
when no AUTHENTICATION_BACKENDS
is specified, backends list defaults to sole ModelBackend
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.