CommandError: You must set settings.ALLOWED_HOSTS if DEBUG is False.

5,659 views
Skip to first unread message

bootcamprag

unread,
Jan 27, 2018, 9:04:17 AM1/27/18
to Django users
Hello 

I am using django 2.0 and I cannot resolve the the error in the subject line when I run the local server. I am in the development phase. Not production. Please assist. Thanks.

r,

Demayne

Jason

unread,
Jan 27, 2018, 9:19:46 AM1/27/18
to Django users
uhm, implement the setting for your enviroment?

Andréas Kühne

unread,
Jan 27, 2018, 10:51:15 AM1/27/18
to django...@googlegroups.com
If you are not running with the following statement in settings.py:

DEBUG = True

AND you have to run the server with "python manage.py runserver", if you are running it in any other way, you have to setup ALLOWED_HOSTS.

You could also (but definitely not recommended) set ALLOWED_HOSTS = ['*']

That would remove the checks for hosts in a production environment.

Regards,

Andréas

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bde54c16-961b-4817-bc22-74ecabffd341%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages