Skip to content

Commit 2404d20

Browse files
alasdairnicoltimgraham
authored andcommitted
Fixed #26309 -- Documented that login URL settings no longer support dotted paths.
1 parent c92123c commit 2404d20

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

docs/internals/deprecation.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ details on these changes.
173173

174174
* The ability to reverse URLs using a dotted Python path will be removed.
175175

176+
* The ability to use a dotted Python path for the ``LOGIN_URL`` and
177+
``LOGIN_REDIRECT_URL`` settings will be removed.
178+
176179
* Support for :py:mod:`optparse` will be dropped for custom management commands
177180
(replaced by :py:mod:`argparse`).
178181

docs/ref/settings.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2624,9 +2624,9 @@ The URL where requests are redirected after login when the
26242624
This is used by the :func:`~django.contrib.auth.decorators.login_required`
26252625
decorator, for example.
26262626

2627-
This setting also accepts view function names and :ref:`named URL patterns
2628-
<naming-url-patterns>` which can be used to reduce configuration duplication
2629-
since you don't have to define the URL in two places (``settings`` and URLconf).
2627+
This setting also accepts :ref:`named URL patterns <naming-url-patterns>` which
2628+
can be used to reduce configuration duplication since you don't have to define
2629+
the URL in two places (``settings`` and URLconf).
26302630

26312631
.. setting:: LOGIN_URL
26322632

@@ -2638,9 +2638,9 @@ Default: ``'/accounts/login/'``
26382638
The URL where requests are redirected for login, especially when using the
26392639
:func:`~django.contrib.auth.decorators.login_required` decorator.
26402640

2641-
This setting also accepts view function names and :ref:`named URL patterns
2642-
<naming-url-patterns>` which can be used to reduce configuration duplication
2643-
since you don't have to define the URL in two places (``settings`` and URLconf).
2641+
This setting also accepts :ref:`named URL patterns <naming-url-patterns>` which
2642+
can be used to reduce configuration duplication since you don't have to define
2643+
the URL in two places (``settings`` and URLconf).
26442644

26452645
.. setting:: LOGOUT_REDIRECT_URL
26462646

@@ -2658,9 +2658,9 @@ The URL where requests are redirected after a user logs out using the
26582658
If ``None``, no redirect will be performed and the logout view will be
26592659
rendered.
26602660

2661-
This setting also accepts view function names and :ref:`named URL patterns
2662-
<naming-url-patterns>` which can be used to reduce configuration duplication
2663-
since you don't have to define the URL in two places (``settings`` and URLconf).
2661+
This setting also accepts :ref:`named URL patterns <naming-url-patterns>` which
2662+
can be used to reduce configuration duplication since you don't have to define
2663+
the URL in two places (``settings`` and URLconf).
26642664

26652665
.. setting:: PASSWORD_RESET_TIMEOUT_DAYS
26662666

docs/releases/1.10.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,9 @@ removed in Django 1.10 (please see the :ref:`deprecation timeline
819819
* The ability to :func:`~django.urls.reverse` URLs using a dotted Python path
820820
is removed.
821821

822+
* The ability to use a dotted Python path for the ``LOGIN_URL`` and
823+
``LOGIN_REDIRECT_URL`` settings is removed.
824+
822825
* Support for ``optparse`` is dropped for custom management commands.
823826

824827
* The class ``django.core.management.NoArgsCommand`` is removed.

docs/releases/1.8.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,6 +1351,9 @@ to ensure compatibility when reversing by Python path is removed in Django 1.10.
13511351
Similarly for GIS sitemaps, add ``name='django.contrib.gis.sitemaps.views.kml'``
13521352
or ``name='django.contrib.gis.sitemaps.views.kmz'``.
13531353

1354+
If you are using a Python path for the :setting:`LOGIN_URL` or
1355+
:setting:`LOGIN_REDIRECT_URL` setting, use the name of the ``url()`` instead.
1356+
13541357
.. _security issue: https://www.djangoproject.com/weblog/2014/apr/21/security/#s-issue-unexpected-code-execution-using-reverse
13551358

13561359
Aggregate methods and modules

0 commit comments

Comments
 (0)