title: Django and Bad Request (400)
body: <p>I created new django project;
  added to my settings.py:</p>
  
  <pre><code>DEBUG = False
  ALLOWED_HOSTS= [
      'localhost',
      'my_site.com'
  ]
  </code></pre>
  
  <p>created app <code>test_view</code>;
  added <code>hello_world</code> to <code>test_view.views</code></p>
  
  <pre><code>from django.http.response import HttpResponse
  
  def hello_world(request):
      return HttpResponse('Hello World!!!')
  </code></pre>
  
  <p>added test route to urls.py <code>url(r'test/', 'test_view.views.hello_world')</code>;
  fixed /etc/hosts</p>
  
  <pre><code>127.0.0.1    localhost my_site.com
  </code></pre>
  
  <p>Now when i'm trying to access <code>http://my_site.com:8000/test/</code> django returns Bad Request (400). But when url is <code>http://localhost:8000/test/</code> I can see my Hello World page. What can be wrong?</p>
  
  <p><strong>UPD:</strong>
  The same result with <code>DEBUG = True</code></p>
  
  <p><strong>UPD2:</strong></p>
  
  <p>One more working hostname is <code>ubuntu-virtualbox</code> (computer's name).
  But even when I changed computer's name to <code>my_site</code>, ubuntu-virtualbox was still available and my_site returned <code>Bad Request (400)</code></p>
  
  <p>May it be because of some system settings? (it's clean ubuntu in virtualbox).
  Or maybe problem in virtualenv? Is there a way to trace the error?</p>