def get_site_from_settings():
    sites = _get_sites_config()

    try:
        current_site_id = getattr(settings, "SITE_ID")
    except AttributeError:
        raise exceptions.SitesNotConfigured()

    if current_site_id not in sites:
        raise exceptions.SitesNotConfigured()

    return Site(sites[current_site_id])
Get site instance from settings
dataset/ETHPy150Open niwinz/django-sites/django_sites/base.py/get_site_from_settings