errors with debug=False


my web app seems to be working fine with debug=True, but when set to False, I get an internal server error. I have researched this topic in depth and I'll show you the steps I've taken based on what I've read.


I collected static files and wrote them in as:

STATIC_ROOT = '/home/DavidW/Blog_Portfolio_App/static' STATIC_URL = '/static/'

MEDIA_ROOT = '/home/DavidW/Blog_Portfolio_App/media' MEDIA_URL = '/media/'

I also wrote the same for the pythonanywhere web section

I have a valid SECRET_KEY in my setting, which imports

the wsgi file points to my settings file and works fine for when debug is true.

Is there anything I'm missing? Please advise. I've read the relevent documentation from pythonanywhere and collectstatic from django.

Thank you


I had these activated in my but was set to TRUE, then later 'true' which is incorrect.



Also, DEBUG has to be set to 'FALSE' not FALSE or 'False,' and also has to point to the same place as the wsgi file. importing from .local works best at the bottom of the file as well. If anyone else is having issues, I hope this helps.

Glad you worked it out, and thanks for posting your solution!


It worked

What worked for me was setting debug='FALSE' with inverted commas


I know the exact solution of the media files are not loading error while setting debug to false. Sol : Be sure not to keep slash at the end of the url of media files in templates, or it will return the error.

That's it. Thank you .