Is it possible that you do not have GZipMiddleware at the top of your settings.MIDDLEWARE_CLASSES
? This can cause strange behavior.
If this is a production server, you probably shouldn't show static files with django at all. I would recommend gunicorn and nginx.
EDIT: If this is not the case, what if you serve the files βmanuallyβ through urls.py using something like:
urlpatterns += staticfiles_urlpatterns() + \ patterns('', (r'^%s/(?P<path>.*)$' % settings.MEDIA_URL.strip('/'), 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), *[(r'^%s/(?P<path>.*)$' % settings.STATIC_URL.strip('/'), 'django.views.static.serve', {'document_root': path, 'show_indexes': True}) for path in settings.STATICFILES_DIRS] )
Alternative # 3: Nginx is pretty easy to install locally, and you can just point it to your Django server (no gunicorn / uwsgi / whatever is needed).
source share