summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAlasdair Nicol <alasdair@thenicols.net>2015-09-16 23:07:39 +0100
committerJosh Smeaton <josh.smeaton@gmail.com>2015-09-21 23:46:21 +1000
commitfe3fc5210f0bb334a679ed420152af1c862c0239 (patch)
treedc41897b19aaac166e62dd455334faa28fad0bab /docs
parent2f53d342f1ce2fb36cddbd90e24c4fda86389c27 (diff)
Fixed #23813 -- Added checks for common URL pattern errors
Thanks jwa and lamby for the suggestions, and timgraham and jarshwah for their reviews.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/checks.txt16
-rw-r--r--docs/releases/1.9.txt2
2 files changed, 18 insertions, 0 deletions
diff --git a/docs/ref/checks.txt b/docs/ref/checks.txt
index 39f3a06089..208e3fb81f 100644
--- a/docs/ref/checks.txt
+++ b/docs/ref/checks.txt
@@ -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.
diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt
index 18fa8ef6bf..f1eba56a1e 100644
--- a/docs/releases/1.9.txt
+++ b/docs/releases/1.9.txt
@@ -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
^^^^^^^^^^