Check Django documentation at `Login URL`_ and `Login redirect URL`_
+ If a custom redirect URL is needed that must be different to LOGIN_URL,
+ define the setting::
+
+ SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/another-login-url/'
+
In case of authentication error, the message can be stored in session
if the following setting is defined::
Check Django documentation at `Login URL`_ and `Login redirect URL`_
+ If a custom redirect URL is needed that must be different to LOGIN_URL,
+ define the setting::
+
+ SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/another-login-url/'
+
In case of authentication error, the message can be stored in session
if the following setting is defined::
from social_auth.utils import sanitize_redirect
-DEFAULT_REDIRECT = getattr(settings, 'LOGIN_REDIRECT_URL', '')
+DEFAULT_REDIRECT = getattr(settings, 'SOCIAL_AUTH_LOGIN_REDIRECT_URL', '') or \
+ getattr(settings, 'LOGIN_REDIRECT_URL', '')
def auth(request, backend):
return HttpResponseRedirect(url)
-def auth_process(request, backend, complete_url_name,
- default_redirect=DEFAULT_REDIRECT):
+def auth_process(request, backend, complete_url_name):
"""Authenticate using social backend"""
redirect = reverse(complete_url_name, args=(backend,))
backend = get_backend(backend, request, redirect)