def get_current_request_hostname():
 hostname = None
 request = get_current_request()
 if request:
  hostname = request.META.get('HTTP_HOST')
 return hostname

def get_current_request_hostname ( ) : hostname = None request = get_current_request ( ) if request : hostname = request . META . get ( 'HTTP_HOST' ) return hostname
this method will return the hostname that was used in the current django request .