1
0
mirror of https://github.com/django/django.git synced 2025-05-01 20:54:38 +00:00

[1.10.x] Documented url()'s 'regex' parameter.

Backport of 0a9bd266ff8e042f53e25928527a29ce896b4955 from master
This commit is contained in:
Adam Chainz 2016-12-23 00:16:26 +00:00 committed by Tim Graham
parent 1a039e76c7
commit 1c9f49e80f
2 changed files with 8 additions and 0 deletions

View File

@ -33,6 +33,13 @@ Helper function to return a URL pattern for serving files in debug mode::
...
]
The ``regex`` parameter should be a string or
:func:`~django.utils.translation.ugettext_lazy()` (see
:ref:`translating-urlpatterns`) that contains a regular expression compatible
with Python's :py:mod:`re` module. Strings typically use raw string syntax
(``r''``) so that they can contain sequences like ``\d`` without the need to
escape the backslash with another backslash.
The ``view`` parameter is a view function or the result of
:meth:`~django.views.generic.base.View.as_view` for class-based views. It can
also be an :func:`include`.

View File

@ -1557,6 +1557,7 @@ will be::
Ensure that you don't have non-prefixed URL patterns that might collide
with an automatically-added language prefix.
.. _translating-urlpatterns:
Translating URL patterns
------------------------