code: def current_site_url():
      
      protocol = getattr(settings, 'MY_SITE_PROTOCOL', 'https')
      port     = getattr(settings, 'MY_SITE_PORT', '')
      url = '%s://%s' % (protocol, settings.SITE_DOMAIN)
      if port:
          url += ':%s' % port
      return url
docs: Returns fully qualified URL (no trailing slash) for the current site.