summaryrefslogtreecommitdiff
path: root/docs/topics/auth
diff options
context:
space:
mode:
authorThinkChaos <ThinkChaos@users.noreply.github.com>2017-06-07 16:48:28 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-02-08 21:08:05 +0100
commitb99d6c9cbc8eecf480892599201eef0d14b20d71 (patch)
treea563f6643d977ba1b97f2674da5e002a700399f5 /docs/topics/auth
parent59841170ba1785ada10a2915b0b60efdb046ee39 (diff)
Fixed #28216 -- Added next_page/get_default_redirect_url() to LoginView.
Diffstat (limited to 'docs/topics/auth')
-rw-r--r--docs/topics/auth/default.txt21
1 files changed, 19 insertions, 2 deletions
diff --git a/docs/topics/auth/default.txt b/docs/topics/auth/default.txt
index 05ccc5eed6..82cf58c128 100644
--- a/docs/topics/auth/default.txt
+++ b/docs/topics/auth/default.txt
@@ -996,17 +996,26 @@ implementation details see :ref:`using-the-views`.
See :doc:`the URL documentation </topics/http/urls>` for details on using
named URL patterns.
- **Attributes:**
+ **Methods and Attributes**
.. attribute:: template_name
The name of a template to display for the view used to log the user in.
Defaults to :file:`registration/login.html`.
+ .. attribute:: next_page
+
+ .. versionadded:: 4.0
+
+ The URL to redirect to after login. Defaults to
+ :setting:`LOGIN_REDIRECT_URL`.
+
.. attribute:: redirect_field_name
The name of a ``GET`` field containing the URL to redirect to after
- login. Defaults to ``next``.
+ login. Defaults to ``next``. Overrides the
+ :meth:`get_default_redirect_url` URL if the given ``GET`` parameter is
+ passed.
.. attribute:: authentication_form
@@ -1043,6 +1052,14 @@ implementation details see :ref:`using-the-views`.
<django.http.HttpRequest.get_host>`, that are safe for redirecting
after login. Defaults to an empty :class:`set`.
+ .. method:: get_default_redirect_url()
+
+ .. versionadded:: 4.0
+
+ Returns the URL to redirect to after login. The default implementation
+ resolves and returns :attr:`next_page` if set, or
+ :setting:`LOGIN_REDIRECT_URL` otherwise.
+
Here's what ``LoginView`` does:
* If called via ``GET``, it displays a login form that POSTs to the