﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33065	DisallowedHost exception when using server/container name to access django service	Robin	nobody	"Hello,

I am using the Django rest framework to provide REST API to other services.

All services have been packaged in docker. and all services are sharing data via the docker network.

Let's say, App A is calling App B(Django) APIs.

because they are on the same docker network then App A can call it like HTTP://server_B_container_name:8000/api/
But I got a DisallwedHost exception. The error message likes this:
""Invalid HTTP_HOST header: 'training_api'. The domain name provided is not valid according to RFC 1034/1035.""

I have set the settings like this.
DJANGO_ALLOWED_HOSTS=localhost,training_api,*

It works if I call it through localhost or fully qualified domain name(port 8000 is exposed to host).

How can I call the Django via container name, not the IP? the IP will change every time it starts.

Thanks,
Robin

"	Uncategorized	new	Uncategorized	3.2	Normal				Unreviewed	0	0	0	0	0	0
