{"id":21001471,"url":"https://github.com/divio/aldryn-sites","last_synced_at":"2025-05-14T23:32:39.450Z","repository":{"id":23448509,"uuid":"26812205","full_name":"divio/aldryn-sites","owner":"divio","description":"Extensions to django.contrib.sites","archived":false,"fork":false,"pushed_at":"2019-02-18T08:50:57.000Z","size":56,"stargazers_count":6,"open_issues_count":6,"forks_count":3,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-03T01:11:09.645Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/divio.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-18T14:13:10.000Z","updated_at":"2019-10-01T19:28:51.000Z","dependencies_parsed_at":"2022-08-22T01:10:47.610Z","dependency_job_id":null,"html_url":"https://github.com/divio/aldryn-sites","commit_stats":null,"previous_names":["aldryn/aldryn-sites"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divio%2Faldryn-sites","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divio%2Faldryn-sites/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divio%2Faldryn-sites/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divio%2Faldryn-sites/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/divio","download_url":"https://codeload.github.com/divio/aldryn-sites/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254248443,"owners_count":22039008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T08:15:25.655Z","updated_at":"2025-05-14T23:32:34.428Z","avatar_url":"https://github.com/divio.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"aldryn-sites\n============\n\n.. image:: https://travis-ci.org/aldryn/aldryn-sites.svg?branch=develop\n    :target: https://travis-ci.org/aldryn/aldryn-sites\n\n.. image:: https://img.shields.io/coveralls/aldryn/aldryn-sites.svg\n  :target: https://coveralls.io/r/aldryn/aldryn-sites\n\nExtensions to django.contrib.sites.\n\nFeatures\n--------\n\n* **Domain redirects**: handles smart redirecting to a main domain from alias domains.\n  Taking http/https into consideration.\n\n* **Site auto-population**: automatically populates the Domain name in ``django.contrib.sites.Site.domain`` based\n  on the ``ALDRYN_SITES_DOMAINS`` setting.\n\n\nInstallation\n------------\n\n\n* add ``aldryn_sites`` to ``INSTALLED_APPS``.\n\n* add ``aldryn_sites.middleware.SiteMiddleware`` to ``MIDDLEWARE_CLASSES``\n  (place it **before** ``djangosecure.middleware.SecurityMiddleware`` if redirects should be smart about alias domains\n  possibly not having a valid certificate of their own. The middleware will pick up on ``SECURE_SSL_REDIRECT`` from\n  ``django-secure``.)\n  \nconfigure ``ALDRYN_SITES_DOMAINS``::\n\n    ALDRYN_SITES_DOMAINS = {\n        1: {  # matches SITE_ID\n            'domain': 'www.example.com',  # main domain that all domains in redirects will redirect to.\n                                          # Auto populates ``django.contrib.sites.Site.domain``\n            'aliases': [                  # these domains will be accessible like the main domain (no redirect).\n                'an.other.domain.com',\n                r'^[a-z0-9-]+\\.anysub\\.com$',  # regexes are supported\n            ],\n            'redirects': [                # these domains will be redirected to the main domain.\n                'example.com',            # add ``'*'`` to redirect all non-main domains to the main one.\n                'example.ch',\n                'www.example.ch',\n                r'^[a-z0-9-]+\\.my-redirect-domain\\.com$',  # regexes are supported\n                r'.*',  # matches any domain (Makes the above rules useless. It's just an example)\n            ],\n        }\n    }\n\nWhen using regexes:\n\n* exact matches win over pattern matches\n* pattern redirect matches win over pattern alias matches\n\n\nFurther Settings\n----------------\n\nset ``ALDRYN_SITES_SET_DOMAIN_NAME`` to ``False`` if you don't want ``django.contrib.sites.Site.domain`` to be\nauto-populated (default: ``True``).\n\n\nTODOS\n-----\n\n* validate settings\n* test settings validators\n* log warning if there are Sites in the database that are not in the settings\n* pretty display of how redirects will work (in admin and as a simple util)\n* regex support for aliases\n* form to test redirect logic\n* pre-compile and cache regexes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivio%2Faldryn-sites","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivio%2Faldryn-sites","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivio%2Faldryn-sites/lists"}