I have moved the django-allauth
login/signup forms to a modal on a custom index page I created. Everything works if the login/signup forms are filled without error, except the issue now is that if the login fails, I am redirected to /accounts/login/
, and if signup fails, I am redirected to /accounts/signup/
. How can I override this behavior, so that I am always redirected back to ra_app:index
?
settings.py
LOGIN_URL = 'ra_app:index'
LOGIN_REDIRECT_URL = 'ra_app:index'
ACCOUNT_LOGIN_REDIRECT_URL = 'ra_app:index'
ACCOUNT_LOGOUT_REDIRECT_URL = 'ra_app:index'
ACCOUNT_AUTHENTICATION_METHOD = 'email'
ACCOUNT_EMAIL_REQUIRED = True # Used in conjunction with ACCOUNT_AUTHENTICATION_METHOD to ensure ability to login
ACCOUNT_USERNAME_REQUIRED = False # Used in conjuction with ACCOUNT_AUTHENTICATION_METHOD to ensure ability to login
ACCOUNT_LOGOUT_ON_GET = True # Logout without confirmation
You can use a custom account adapter. assuming that your 'ra_app:index' is your base url