old_contents: from django.contrib.sites.models import get_current_site
  
  def get_domain(request=None):
      return "http://" + str(get_current_site(request))
  
new_contents: from django.contrib.sites.models import get_current_site
  from django.conf import settings
  
  
  def get_domain(request=None, protocol=None):
      protocol = protocol or getattr(settings, "SITE_PROTOCOL", None) or 'http'
      return "{0}://{1}".format(protocol, get_current_site(request))
  
subject: make get_domain more flexible