solution of You must set settings.ALLOWED_HOSTS if DEBUG is False.

1,174 views
Skip to first unread message

fatima zahra ait lhaj

unread,
Feb 12, 2023, 5:24:40 PM2/12/23
to Django users
it's setting.py file
setting.png

 ==> python  manage.py runserver
CommandError: You must set settings.ALLOWED_HOSTS if DEBUG is False.

Alan Wang

unread,
Feb 20, 2023, 9:50:43 PM2/20/23
to Django users
Please try to add "localhost" in your ALLOWED_HOSTS list.

ALLOWED_HOSTS = ["localhost"]
Reply all
Reply to author
Forward
0 new messages