mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #23813 -- Added checks for common URL pattern errors
Thanks jwa and lamby for the suggestions, and timgraham and jarshwah for their reviews.
This commit is contained in:
parent
2f53d342f1
commit
fe3fc5210f
11 changed files with 194 additions and 1 deletions
|
@ -81,6 +81,7 @@ Django's system checks are organized using the following tags:
|
|||
* ``security``: Checks security related configuration.
|
||||
* ``templates``: Checks template related configuration.
|
||||
* ``caches``: Checks cache related configuration.
|
||||
* ``urls``: Checks URL configuration.
|
||||
|
||||
Some checks may be registered with multiple tags.
|
||||
|
||||
|
@ -580,3 +581,18 @@ configured:
|
|||
|
||||
* **caches.E001**: You must define a ``'default'`` cache in your
|
||||
:setting:`CACHES` setting.
|
||||
|
||||
URLs
|
||||
----
|
||||
|
||||
The following checks are performed on your URL configuration:
|
||||
|
||||
* **urls.W001**: Your URL pattern ``<pattern>`` uses
|
||||
:func:`~django.conf.urls.include` with a ``regex`` ending with a
|
||||
``$``. Remove the dollar from the ``regex`` to avoid problems
|
||||
including URLs.
|
||||
* **urls.W002**: Your URL pattern ``<pattern>`` has a ``regex``
|
||||
beginning with a ``/``. Remove this slash as it is unnecessary.
|
||||
* **urls.W003**: Your URL pattern ``<pattern>`` has a ``name``
|
||||
including a ``:``. Remove the colon, to avoid ambiguous namespace
|
||||
references.
|
||||
|
|
|
@ -641,6 +641,8 @@ URLs
|
|||
of (<list of patterns>, <application namespace>) as the first argument to
|
||||
:func:`~django.conf.urls.include`.
|
||||
|
||||
* System checks have been added for common URL pattern mistakes.
|
||||
|
||||
Validators
|
||||
^^^^^^^^^^
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue