kwargs problem with staticfiles.urls static() function
limist opened this issue · comments
I came across this problem when modifying my site-wide urls.py to serve files under a media/ directory; to do so I needed to add a line like,
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Of course, one needs to import the static function above; when I use the function from staticfiles.urls, I see a TypeError is thrown with the url() function, kwargs, and document_root. But when I use the static function from django.conf.urls.static, no problem. The only difference I can see between the two is the last line, the return statement. The staticfiles version passes **kwargs, and the django.conf version passes kwargs=kwargs.