diff options
| author | Adam Chainz <me@adamj.eu> | 2016-12-23 00:16:26 +0000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-12-22 19:16:56 -0500 |
| commit | 1c9f49e80f08f8b2ee2f33bd56bd3d9395feab70 (patch) | |
| tree | e9b5f70092e382462ee2db8e3256c6c152b72eb3 /docs | |
| parent | 1a039e76c74c5dbea0943782bfba9924e8051a4e (diff) | |
[1.10.x] Documented url()'s 'regex' parameter.
Backport of 0a9bd266ff8e042f53e25928527a29ce896b4955 from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/urls.txt | 7 | ||||
| -rw-r--r-- | docs/topics/i18n/translation.txt | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/docs/ref/urls.txt b/docs/ref/urls.txt index 37df9a30cf..d1464da66d 100644 --- a/docs/ref/urls.txt +++ b/docs/ref/urls.txt @@ -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`. diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt index cae4c264ea..a954c61058 100644 --- a/docs/topics/i18n/translation.txt +++ b/docs/topics/i18n/translation.txt @@ -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 ------------------------ |
