I’m a little stumped. In development, I’m trying to serve both static AND dynamic files for my app in DJango 1.3. I love the new static features, but I can’t seem to get this to work properly.
When I read the docs, it looks like the following should work. It serves dynamic stuff fine, but not static.
urlpatterns += staticfiles_urlpatterns()
if settings.DEBUG:
urlpatterns += patterns('',
url(r'^media/dynamic/(?P<path>.*)$', 'django.views.static.serve', {
'document_root': settings.MEDIA_ROOT,
}),
)
In django 1.3 static and dynamic content have been separated. to use the new features, set up your project like this:
settings.py
urls.py