DEBUG = False breaks templates
I can load /admin locally & on heroku, but the template directory doesn't seem to load properly once I have DEBUG = False.
Switching it to True in settings/local.py properly renders the admin templates locally.
Does this have something to do with Django 1.5's requirement for ALLOWED_HOSTS? I currently have it set to ALLOWED_HOSTS = ['*']
Any help would be apprecaited
Answers
I ran into the same error and it has to do with the way Django serves static files. In DEBUG=True mode, Django serves the static files for you but turns it off when DEBUG=False.
To fix this, I changed the Procfile so Heroku runs the command collectstatic and runserver with the --insecure flag:
web: python manage.py collectstatic --noinput; python manage.py runserver 0.0.0.0:$PORT --noreload --insecure
On your local machine, you can do $ python manage.py runserver --insecure
Now when DEBUG=False, it will still serve your static files.
Can you explain "load properly"?