New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Django not fetching compressed files when Debug set to False #348
Comments
Hi, We are going to need a little more info about your setup to help you:
Thanks |
Hi, I am using Django 1.4.3, with the following settings:
Files that I manually put within |
Also, runserver successfully fetches the files in my |
Sorry, can't believe I missed that earlier : I somehow read that you had problems when DEBUG is True. Anyway. When DEBUG = False, your runserver will, by default, refuse to serve staticfiles itself, because of performance and security issues. This is to prevent you from using this in production. To be able to properly test your staticfiles locally when DEBUG is False, you need to pass the --insecure flag to runserver, like documented here: https://docs.djangoproject.com/en/1.4/ref/contrib/staticfiles/#django-admin-option---insecure Does that fix your issue ? |
Oh gosh, my bad. I had inadvertently switched "True" and "False" in my original question, sorry for the confusion! And thanks so much, that does solve the issue! |
So I got django-compressor working in development with Debug = False. However, once I set Debug = True, django-compressor seems to generate the correct URLs, files, and everything, but Django itself returns a 404 for those files.
I have
and inside the static_media folder in my project, I can indeed see the CACHE/css/bfdeac875f7a.css file that was created by the compressor.
Inside the generated HTML file, I can also see
but when the page is loaded, runserver says:
Am I missing something? I have already
'django.core.context_processors.static',
toTEMPLATE_CONTEXT_PROCESSORS
'compressor.finders.CompressorFinder',
toSTATICFILES_FINDERS
'compressor',
toINSTALLED_APPS
Thanks!
The text was updated successfully, but these errors were encountered: