Opened 6 years ago

Closed 6 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: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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é 6 years ago.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by Bruno Renié

Attachment: 15314-static.diff added

comment:1 Changed 6 years ago by Bruno Renié

Has patch: set
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:2 Changed 6 years ago by Jannis Leidel

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

comment:3 Changed 6 years ago by Jannis Leidel

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