Browse Source

Refs #28593 -- Changed url() to path() in comments following URL routing changes.

Tobias Bengfort 5 years ago
parent
commit
7619a33665
2 changed files with 2 additions and 2 deletions
  1. 1 1
      django/contrib/staticfiles/views.py
  2. 1 1
      django/views/static.py

+ 1 - 1
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<path>.*)$', views.serve)
+        path('<path:path>', views.serve)
 
     in your URLconf.
 

+ 1 - 1
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<path>.*)$', serve, {'document_root': '/path/to/my/files/'})
+        path('<path: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