Django production Server Error or Interval Server Error with no logs
Project id: 1ba89116-6373-47f4-9cf9-785a08acae4c
When deploying my site with DEBUG=True it works fine, but setting it to False even after setting allowed hosts to my custom domain just gives one of the two above errors. I cannot see the server logs in production and there are no deploy logs. I have whitenoise installed and fixed an issue where the collected static folder wasn't pushed as it was in the gitignore. My static tags seems to be fine and have no prepended slash and I can't see what else it could be. I even tried removing the static imports and it still wouldn't work.
I have env variable of DISABLE_COLLECTSTATIC = 0
Relevant settings are below
Solution:Jump to solution
Adding
python manage.py collectstatic --noinput
to my ProcFile and fixing some filename references seemed to work9 Replies
Project ID:
1ba89116-6373-47f4-9cf9-785a08acae4c
Additionally I tried adding verbose logging for when DEBUG=False as below but don't know how to access them:
My ProcFile:
web: gunicorn <app>.wsgi --log-file gunicorn.log
I can't tell that it's collecting static files either, should I add this to the procfile?you need to log to stdout / stderr or else you wont be able to see the logs in the deployment logs window, change your procfile to
as per their docs: https://docs.gunicorn.org/en/stable/settings.html#errorlog
This is all that's logged now:
oh wait just got a bunch
Okay seems something to do with static files
ValueError: Missing staticfiles manifest entry for 'main/css/base.css'
just a configuration error
Solution
Adding
python manage.py collectstatic --noinput
to my ProcFile and fixing some filename references seemed to workperfect
Thanks!
no problem!