title: How to capture the subdomain in a django view?
body: <p>I'm developing an aplication in django with many subdomains. For example www.mysite.com, mx.mysite.com, es.mysite.com, nz.mysite.com 
  All of these patterns have to redirect to the same django aplication and render the html page with the country language.</p>
  
  <p>is there any way to capture the sub domain in the views.py?</p>
  
  <p>I want something like this in views.py: </p>
  
  <pre><code>######## VIEWS.PY ###########
  def hompage(request):
      subdomain = #HERE IS WHERE I WANT TO CAPTURE THE SUBDOMAIN 
      if subdomain=='www':
          contextdict = {"Language": "English"}
      else if subdomain=='mx':
          contextdict = {"Language": "Spanish"}
      return render(request, 'mysite/index.html', contextdict)
  </code></pre>