Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removes document_root argument from django.contrib.staticfiles.views.…

…serve

This argument can be removed, because the new way of finding static files doesn't take document_root into account at all.
  • Loading branch information...
commit 2db9cbe97c3f375e1db6759db73cf15d09341420 1 parent c12891e
Fako Berkers fako authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/contrib/staticfiles/views.py
2  django/contrib/staticfiles/views.py
View
@@ -17,7 +17,7 @@
from django.contrib.staticfiles import finders
-def serve(request, path, document_root=None, insecure=False, **kwargs):
+def serve(request, path insecure=False, **kwargs):
"""
Serve static files below a given point in the directory structure or
from locations inferred from the staticfiles finders.

1 comment on commit 2db9cbe

Mark Jones

By doing this you seem to be preventing the use of alternate document roots.

In particular you prevent uses like this

        url(r'^Ext/(?P<path>.*)$', static_view,
            {"document_root": path.join(settings.PROJECT_ROOT, "Ext"),}),

Because now you can end up passing document_root twice to static.serve

serve() got multiple values for keyword argument 'document_root'

Please sign in to comment.
Something went wrong with that request. Please try again.