python-social-auth
is a newer, derived version of django-social-auth
.
AlexYar’s answer can be slightly modified to work with python-social-auth
by modify settings.py
with following changes:
-
Add a middleware to handle the SocialAuthException
MIDDLEWARE_CLASSES += ( 'social.apps.django_app.middleware.SocialAuthExceptionMiddleware', )
-
URL to redirect to, when an exception occurred
SOCIAL_AUTH_LOGIN_ERROR_URL = "https://stackoverflow.com/"
-
Note that you also need to set
DEBUG = False
That’s all or read http://python-social-auth.readthedocs.org/en/latest/configuration/django.html#exceptions-middleware