  :attr:`~django.contrib.sites.models.Site.domain`.
  
  Here's an example of what the form-handling view looks like::
  
      from django.contrib.sites.models import Site
      from django.core.mail import send_mail
  
      def register_for_newsletter(request):
          # Check form values, etc., and subscribe the user.
          # ...
 
</s> remove         current_site = Site.objects.get_current()
 </s> add         current_site = get_current_site(request) </s> remove       from django.conf import settings
 </s> add       from django.contrib.sites.models import get_current_site </s> remove The idiom of retrieving the :class:`~django.contrib.sites.models.Site` object
for the value of :setting:`settings.SITE_ID <SITE_ID>` is quite common, so
the :class:`~django.contrib.sites.models.Site` model's manager has a
``get_current()`` method. This example is equivalent to the previous one::
 </s> add This has also the advantage of checking if the sites framework is installed, and
return a :class:`RequestSite` instance if it is not.

If you don't have access to the request object, you can use the
``get_current()`` method of the :class:`~django.contrib.sites.models.Site`
model's manager. You should then ensure that your settings file does contain
the :setting:`SITE_ID` setting. This example is equivalent to the previous one:: </s> remove     def my_view(request):
 </s> add     def my_function_without_request(): </s> remove     from django.conf import settings
    from django.contrib.sites.models import Site
 </s> add     from django.contrib.sites.models import get_current_site
    from django.contrib.sites.models import get_current_site
  :attr:`~django.contrib.sites.models.Site.domain`.
  
  Here's an example of what the form-handling view looks like::
  
    from django.contrib.sites.models import get_current_site
      from django.core.mail import send_mail
  
      def register_for_newsletter(request):
          # Check form values, etc., and subscribe the user.
          # ...
keep keep keep keep replace keep keep keep keep keep
 Made more extensive use of get_current_site

Refs #15089 
docs/ref/contrib/sites.txt