Opened 14 years ago

Closed 14 years ago

#15314 closed (fixed)

Kwargs need to be passed as a non-positional argument in django.conf.urls.static

Reported by: Bruno Renié Owned by: Jannis Leidel
Component: contrib.staticfiles Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The new django.conf.urls.static helper added in r15530 is not usable as stated in the docs:

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

gives a TypeError, url() got an unexpected keyword argument 'document_root'.

This is because the url() function needs kwargs instead of **kwargs.

Attachments (1)

15314-static.diff (523 bytes ) - added by Bruno Renié 14 years ago.

Download all attachments as: .zip

Change History (4)

by Bruno Renié, 14 years ago

Attachment: 15314-static.diff added

comment:1 by Bruno Renié, 14 years ago

Has patch: set

comment:2 by Jannis Leidel, 14 years ago

Component: Uncategorizeddjango.contrib.staticfiles
Owner: changed from nobody to Jannis Leidel
Triage Stage: UnreviewedReady for checkin

comment:3 by Jannis Leidel, 14 years ago

Resolution: fixed
Status: newclosed

In [15552]:

Fixed #15314 -- Added tests for the static URL pattern function added in r15530 and made sure the kwargs are passed to the view correctly. Thanks for the report and initial patch, Bruno Renié.

Note: See TracTickets for help on using tickets.
Back to Top