def get_site_from_settings():
    """
    Get site instance from settings
    configuration.
    """
    sites = _get_sites_config()

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

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

    return Site(sites[current_site_id])
dataset/ETHPy150Open niwinz/django-sites/django_sites/base.py/get_site_from_settings