jorgebastida/django-dajaxice — pull request #94 by joaofrancese (2013-03-18 18:07:17+00:00)
Title: Fix staticfiles finder in Windows failing when STATIC_URL is a full URL

I had a full URL as my STATIC_URL setting (something like http://www.example.com/static/) and I was getting 404s for /static/dajaxice/dajaxice.core.js when testing my site locally (with manage.py runserver). This commit fixed it for me. It seemed to happen because staticfiles.views.serve was handing down to Dajaxice's finder a path with forward slashes, whereas it was expecting a path with backwards slashes.

I had to do a bit of a hack in my urls.py to get staticfiles to serve my files even with a full URL in STATIC_URL (is there a better way? I'm not aware of one), so I guess this isn't a common use case.

from django.conf.urls.static import static
prefix = extract_path(settings.STATIC_URL)
urlpatterns += static(prefix, view='django.contrib.staticfiles.views.serve')