From 8eb913eabf98c4808550fb99d2da9364645e62b8 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 4 Feb 2019 10:36:44 -0500 Subject: [PATCH] [2.2.x] Simplified and corrected LOGIN_URL, LOGIN_REDIRECT_URL, and LOGOUT_REDIRECT_URL docs. Backport of b709d701303b3877387020c1558a590713b09853 from master. --- docs/ref/settings.txt | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index dec8a39269..fa3cc160f7 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -2793,15 +2793,9 @@ The model to use to represent a User. See :ref:`auth-custom-user`. Default: ``'/accounts/profile/'`` -The URL where requests are redirected after login when the -``contrib.auth.login`` view gets no ``next`` parameter. - -This is used by the :func:`~django.contrib.auth.decorators.login_required` -decorator, for example. - -This setting also accepts :ref:`named URL patterns ` which -can be used to reduce configuration duplication since you don't have to define -the URL in two places (``settings`` and URLconf). +The URL or :ref:`named URL pattern ` where requests are +redirected after login when the :class:`~django.contrib.auth.views.LoginView` +doesn't get a ``next`` GET parameter. .. setting:: LOGIN_URL @@ -2810,12 +2804,11 @@ the URL in two places (``settings`` and URLconf). Default: ``'/accounts/login/'`` -The URL where requests are redirected for login, especially when using the -:func:`~django.contrib.auth.decorators.login_required` decorator. - -This setting also accepts :ref:`named URL patterns ` which -can be used to reduce configuration duplication since you don't have to define -the URL in two places (``settings`` and URLconf). +The URL or :ref:`named URL pattern ` where requests are +redirected for login when using the +:func:`~django.contrib.auth.decorators.login_required` decorator, +:class:`~django.contrib.auth.mixins.LoginRequiredMixin`, or +:class:`~django.contrib.auth.mixins.AccessMixin`. .. setting:: LOGOUT_REDIRECT_URL @@ -2824,17 +2817,13 @@ the URL in two places (``settings`` and URLconf). Default: ``None`` -The URL where requests are redirected after a user logs out using -:class:`~django.contrib.auth.views.LogoutView` (if the view doesn't get a -``next_page`` argument). +The URL or :ref:`named URL pattern ` where requests are +redirected after logout if :class:`~django.contrib.auth.views.LogoutView` +doesn't have a ``next_page`` attribute. If ``None``, no redirect will be performed and the logout view will be rendered. -This setting also accepts :ref:`named URL patterns ` which -can be used to reduce configuration duplication since you don't have to define -the URL in two places (``settings`` and URLconf). - .. setting:: PASSWORD_RESET_TIMEOUT_DAYS ``PASSWORD_RESET_TIMEOUT_DAYS``