summaryrefslogtreecommitdiff
path: root/docs/ref/views.txt
diff options
context:
space:
mode:
authorSjoerd Job Postmus <sjoerdjob@sjec.nl>2016-10-20 19:29:04 +0200
committerTim Graham <timograham@gmail.com>2017-09-20 18:04:42 -0400
commitdf41b5a05d4e00e80e73afe629072e37873e767a (patch)
treebaaf71ae695e2d3af604ea0d663284cb406c71e4 /docs/ref/views.txt
parentc4c128d67c7dc2830631c6859a204c9d259f1fb1 (diff)
Fixed #28593 -- Added a simplified URL routing syntax per DEP 0201.
Thanks Aymeric Augustin for shepherding the DEP and patch review. Thanks Marten Kenbeek and Tim Graham for contributing to the code. Thanks Tom Christie, Shai Berger, and Tim Graham for the docs.
Diffstat (limited to 'docs/ref/views.txt')
-rw-r--r--docs/ref/views.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/ref/views.txt b/docs/ref/views.txt
index dd1897c915..37204e2fda 100644
--- a/docs/ref/views.txt
+++ b/docs/ref/views.txt
@@ -26,13 +26,14 @@ built-in handling for user-uploaded files, but you can have Django serve your
:setting:`MEDIA_ROOT` by appending something like this to your URLconf::
from django.conf import settings
+ from django.urls import re_path
from django.views.static import serve
# ... the rest of your URLconf goes here ...
if settings.DEBUG:
urlpatterns += [
- url(r'^media/(?P<path>.*)$', serve, {
+ re_path(r'^media/(?P<path>.*)$', serve, {
'document_root': settings.MEDIA_ROOT,
}),
]