Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does setting debug to false in django settings stop Heroku app from loading in development and production?

Tags:

django

heroku

In my settings i have set DEBUG=False but this instead generated a 500 Error in both dev and production. so i looked around and came across this (Setting DEBUG = False causes 500 Error) and tried it out.

ALLOWED_HOSTS = ['www.heroku.com']

But this did not work, what am i not doing right? Am hosting with heroku

like image 391
Suziemac Tani Avatar asked Apr 25 '13 15:04

Suziemac Tani


People also ask

What is debug false?

The DEBUG=True , if there is error, page will show details of error. if DEBUG=False , the ALLOWED_HOSTS of settings.py will work, you should take carefully to set it. the media and static will not provide access for DEBUG=False , you have to provide them with the help of webserver, like Nginx or Apache .

How do I change debug true to false?

Most importantly, you should never run Arches in production with DEBUG = True . Open your settings.py file (or settings_local.py ) and set DEBUG = False (just add that line if necessary).

Does Heroku run collectstatic?

Collectstatic during buildsWhen a Django application is deployed to Heroku, $ python manage.py collectstatic --noinput is run automatically during the build.


2 Answers

Your app is not hosted on www.heroku.com. Instead, try

ALLOWED_HOSTS = [".herokuapp.com"]
like image 128
Alasdair Avatar answered Sep 19 '22 13:09

Alasdair


did you try

python manage.py collecstatic

?

you should review files directory becuase in prodhuction static files directory changes. heroku uses whitenouse

like image 42
Edison Urquijo Avatar answered Sep 18 '22 13:09

Edison Urquijo