From 7619a33665ccc138c1583a2cce5a5de6d86c9cb4 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Mon, 13 May 2019 18:30:51 +0200 Subject: [PATCH] Refs #28593 -- Changed url() to path() in comments following URL routing changes. --- django/contrib/staticfiles/views.py | 2 +- django/views/static.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/django/contrib/staticfiles/views.py b/django/contrib/staticfiles/views.py index 9987f49f73..6c36e7a91b 100644 --- a/django/contrib/staticfiles/views.py +++ b/django/contrib/staticfiles/views.py @@ -21,7 +21,7 @@ def serve(request, path, insecure=False, **kwargs): from django.contrib.staticfiles import views - url(r'^(?P.*)$', views.serve) + path('', views.serve) in your URLconf. diff --git a/django/views/static.py b/django/views/static.py index 90bad8db7e..d4888545a6 100644 --- a/django/views/static.py +++ b/django/views/static.py @@ -24,7 +24,7 @@ def serve(request, path, document_root=None, show_indexes=False): from django.views.static import serve - url(r'^(?P.*)$', serve, {'document_root': '/path/to/my/files/'}) + path('', serve, {'document_root': '/path/to/my/files/'}) in your URLconf. You must provide the ``document_root`` param. You may also set ``show_indexes`` to ``True`` if you'd like to serve a basic index