def get_by_id(id):
    sites = _get_sites_config()

    try:
        return Site(sites[id])
    except KeyError:
        raise exceptions.SiteNotFound("Site with id '{}' not found".format(id))
Get site instance from settings configuration.
dataset/ETHPy150Open niwinz/django-sites/django_sites/base.py/get_by_id