redirect_to_login(next, login_url=None, redirect_field_name='next')
Redirects to the login page, and then back to another URL after a successful login.
Required arguments:
-
next: The URL to redirect to after a successful login.
Optional arguments:
-
login_url: The URL of the login page to redirect to. Defaults tosettings.LOGIN_URLif not supplied. -
redirect_field_name: The name of aGETfield containing the URL to redirect to after log out. Overridesnextif the givenGETparameter is passed.
Please login to continue.