Code

Opened 3 years ago

Closed 3 years ago

#15314 closed (fixed)

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

Reported by: brutasse Owned by: jezdez
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 brutasse 3 years ago.

Download all attachments as: .zip

Change History (4)

Changed 3 years ago by brutasse

comment:1 Changed 3 years ago by brutasse

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

comment:2 Changed 3 years ago by jezdez

  • Component changed from Uncategorized to django.contrib.staticfiles
  • Owner changed from nobody to jezdez
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:3 Changed 3 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

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é.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.