I was completely puzzled for 30 minutes, but I think that my problems should be related to the changes in Django 1.3.
My urls.py looks like this:
if settings.DEBUG: urlpatterns += patterns('', (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT, 'show_indexes': True}), (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), (r'^admin_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.ADMIN_MEDIA_ROOT}), )
If I visit / static /, I get a list of files. For example, in my root directory there is a file "iphone.png". Going to /static/iphone.png I get a 404 message.
If I changed this section to:
if settings.DEBUG: urlpatterns += patterns('', (r'^otherstatic/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT, 'show_indexes': True}), (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), (r'^admin_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.ADMIN_MEDIA_ROOT}), )
Everything related to / otherstatic / works great.
I should also add that problems with / media / or / admin_media /.
Is this related to the Django new staticfiles application? (If so, who thought it would be a good idea to completely break this very simple use case?)
Thanks!