Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialHerman Brummer
6,414 PointsERROR: Invalid HTTP_HOST header: '0.0.0.0:8000'. You may need to add '0.0.0.0' to ALLOWED_HOSTS.
I updated the settings.py file with:
ALLOWED_HOSTS = [0.0.0.0]
But that does not work and now only get:
"0.0.0.0 refused to connect. Search Google for 8000 ERR_CONNECTION_REFUSED"
4 Answers
Lucas Diz
4,804 PointsProbably dont need to put the numbers after the runserver command. So, inside the learning_site directory write on your terminal:
python3 manage.py runserver
This should work just fine.
jay aljoe
4,113 Points#settings.py
#make sure you have quotes
ALLOWED_HOSTS = ["0.0.0.0"]
Kyle Salisbury
Full Stack JavaScript Techdegree Student 16,363 PointsIf you are running off something like PyCharm and using Chrome, try server 127.0.0.1:8000
Anna Muravyeva
12,162 PointsI tried this, but then got another error: ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
Turned out, since I was working in a virtual environment, I had to install Django again.
Paul Kamarudin
5,292 PointsPaul Kamarudin
5,292 PointsAre you using workspace or a local version on your laptop?
If on your laptop, what version of Django are you using? Have you got DEBUG set to TRUE or FALSE?
Let me know and we can walk thru.