title: Invalid HTTP_HOST header: The domain name provided is not valid -- requests to dockerized django app using container name
body: <p>Within an app composed of multiple microservices run via docker-compose, I need a way to make a request from one container (<code>app</code> via flask &amp; requests), directly to the other (<code>chart</code>/django):</p>
  
  <p>This is a simplified version of what I'm attempting.</p>
  
  <p>routes.py:</p>
  
  <pre><code>@APP.route('/post_data', methods=['POST'])
  def post_data():
    post_data = request.get_json()
    response = requests.post('http://chart_app_1:8080/json/', data=post_data)
    return response.text
  </code></pre>
  
  <p>The response I get is an error message:</p>
  
  <pre><code>django.core.exceptions.DisallowedHost: Invalid HTTP_HOST header: 'chart_app_1:8080'. The domain name provided is not valid according to RFC 1034/1035
  </code></pre>
  
  <p>I'm able to make exactly this kind of request to other containers running flask apps, with no problems. I don't have any control over whether or not we use Django for this particular microservice though.</p>
  
  <p>It seems that this might be because the hostname has an underscore in it: <a href="https://groups.google.com/forum/#!msg/zulip-devel/r1v8DNlsjSU/w6aBra5UAgAJ" rel="noreferrer" title="see this post">see this post</a>.  Is there a way around this? It seems like it must be possible to make a simple request between containers.</p>