code: def request_host(request):
      
      url = request.get_full_url()
      host = urlparse(url)[1]
      if host == "":
          host = request.get_header("Host", "")
  
      # remove port, if present
      host = cut_port_re.sub("", host, 1)
      return host.lower()
docs: Return request-host, as defined by RFC 2965.
  
      Variation from RFC: returned value is lowercased, for convenient
      comparison.