  * It lets the site developers use the same Django view code for both sites.
    The view code that displays a given story just checks to make sure the
    requested story is on the current site. It looks something like this::
  
        from django.conf import settings
  
        def article_detail(request, article_id):
            try:
                a = Article.objects.get(id=article_id, sites__id__exact=settings.SITE_ID)
            except Article.DoesNotExist:
 
</s> remove               a = Article.objects.get(id=article_id, sites__id__exact=settings.SITE_ID)
 </s> add               a = Article.objects.get(id=article_id, sites__id__exact=get_current_site(request).id) </s> remove     sites.get_current().domain, for example, as that is unique across a Django
 </s> add     sites.get_current_site().domain, for example, as that is unique across a Django </s> remove For code which relies on getting the current domain but cannot be certain
that the sites framework will be installed for any given project, there is a
utility function :func:`~django.contrib.sites.models.get_current_site` that
takes a request object as an argument and returns either a Site instance (if
the sites framework is installed) or a RequestSite instance (if it is not).
This allows loose coupling with the sites framework and provides a usable
fallback for cases where it is not installed.

.. function:: get_current_site(request)

    Checks if contrib.sites is installed and returns either the current
    :class:`~django.contrib.sites.models.Site` object or a
    :class:`~django.contrib.sites.models.RequestSite` object based on
    the request.

 </s> add  </s> remove   checks the current :setting:`SITE_ID` in retrieving flatpages to display.
 </s> add   checks the current site in retrieving flatpages to display. </s> remove hard-coding is best for hackish fixes that you need done quickly. A slightly
 </s> add hard-coding is best for hackish fixes that you need done quickly. The
      from django.contrib.sites.models import get_current_site
  * It lets the site developers use the same Django view code for both sites.
    The view code that displays a given story just checks to make sure the
    requested story is on the current site. It looks something like this::
  
      from django.contrib.sites.models import get_current_site
  
        def article_detail(request, article_id):
            try:
                a = Article.objects.get(id=article_id, sites__id__exact=settings.SITE_ID)
            except Article.DoesNotExist:
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