Django Allowed Hosts Error "Invalid HTTP_HOST header: '0.0.0.0:8000'"

nahascoHOBBY

a year ago

I am getting this error sent to my admin email from the application I deployed on railway.app

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

and

Invalid HTTP_HOST header: '35.197.110.103:7010'. You may need to add '35.197.110.103' to ALLOWED_HOSTS

The application works fine with no issues but I randomly get these errors sent to the admin email.

Do I add these to addresses to my allowed hosts? Are these the addresses associated with my railway project?

2 Replies

nahascoHOBBY

a year ago

643c9962-5fa0-449c-82e0-67b30f66c552


a year ago

you can add these to the allowed hosts


nahascoHOBBY

a year ago

Thanks for the quick response. Can you explain what these or and where are they coming from? Especially the ip address, how would i know that without getting the error?


a year ago

the first one is local address and the second one is a gcp ip


nahascoHOBBY

a year ago

I guess the gcp ip is different for different projects or deployments, if thats the case how would I find the gcp ip of my deployment?


a year ago

that wouldn't be necessary, ideally you would turn off these kinds of notifications


mangometerHOBBY

a month ago

i am getting some kind of similar issue: Invalid HTTP_HOST header: '......railway.app'. You may need to add '........railway.app' to ALLOWED_HOSTS. but everything is set correctly and on localhost everything works perfect i am out of clues.... its a django app


mangometer

i am getting some kind of similar issue: Invalid HTTP_HOST header: '......railway.app'. You may need to add '........railway.app' to ALLOWED_HOSTS. but everything is set correctly and on localhost everything works perfect i am out of clues.... its a django app

mangometerHOBBY

a month ago

had to omit the https:// for the allowed hosts problem solved !!


Django Allowed Hosts Error "Invalid HTTP_HOST header: '0.0.0.0:8000'" - Railway Help Station