Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Allowed_Hosts Error.

Tags:

python

django

I'm trying to run a django server with ./manage.py runserver

But appears this error:

Invalid HTTP_HOST header: '127.0.0.1:8000'. You may need to add '127.0.0.1' to ALLOWED_HOSTS.

Please help me.

like image 267
user7412219 Avatar asked Jan 26 '17 19:01

user7412219


1 Answers

Just do this

myapp
|______myapp
           |______settings.py

Inside that there should be a line:

ALLOWED_HOSTS = []

Make it instead

ALLOWED_HOSTS = ["127.0.0.1"]
like image 67
Octo Avatar answered Sep 20 '22 19:09

Octo