{"id":21068912,"url":"https://github.com/nephila/djangocms-multisite","last_synced_at":"2025-08-24T16:39:40.854Z","repository":{"id":43719343,"uuid":"61067582","full_name":"nephila/djangocms-multisite","owner":"nephila","description":"django-multisite support for DjangoCMS","archived":false,"fork":false,"pushed_at":"2023-08-08T15:28:23.000Z","size":59,"stargazers_count":26,"open_issues_count":10,"forks_count":19,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-09-18T06:18:54.396Z","etag":null,"topics":["cms","django","djangocms","multisite","python"],"latest_commit_sha":null,"homepage":"","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/nephila.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-13T20:31:28.000Z","updated_at":"2023-11-14T23:54:22.000Z","dependencies_parsed_at":"2022-09-17T15:18:29.287Z","dependency_job_id":null,"html_url":"https://github.com/nephila/djangocms-multisite","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nephila%2Fdjangocms-multisite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nephila%2Fdjangocms-multisite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nephila%2Fdjangocms-multisite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nephila%2Fdjangocms-multisite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nephila","download_url":"https://codeload.github.com/nephila/djangocms-multisite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225405160,"owners_count":17469294,"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":["cms","django","djangocms","multisite","python"],"created_at":"2024-11-19T18:29:13.796Z","updated_at":"2024-11-19T18:29:14.470Z","avatar_url":"https://github.com/nephila.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"===================\ndjangocms-multisite\n===================\n\n`django-multisite \u003chttps://github.com/ecometrica/django-multisite\u003e`_ support for DjangoCMS\n\n|Gitter| |PyPiVersion| |PyVersion| |Status| |TestCoverage| |TestCoveralls| |CodeClimate| |License|\n\nSupport\n=======\n\nSupported *Django* versions:\n\n* Django 3.0\n* Django 2.2\n\nSupported django CMS versions:\n\n* django CMS 3.7\n\nAssumptions\n===========\n\n#. A virtualenv up and running\n#. DjangoCMS working\n\nInstallation\n============\n\n``pip install djangocms-multisite``\n\nUsage\n=====\n\n#. Open your ``settings.py`` file\n\n#. We need to add the configurations for `django-multisite \u003chttps://github.com/ecometrica/django-multisite\u003e`_ :\n\n   * Replace SITE_ID value with the SiteID function::\n\n        from multisite import SiteID\n        SITE_ID = SiteID(default=1)\n\n   * Add ``multisite``, ``djangocms_multisite`` to ``INSTALLED_APPS``::\n\n        INSTALLED_APPS=[\n            ...\n            'multisite',\n            'djangocms_multisite',\n            ...\n        ]\n   * Add those loders in the TEMPLATES setting::\n\n        TEMPLATES = [\n            ...\n            {\n                ...\n                'DIRS': {...}\n                'OPTIONS': {\n                    'loaders': (\n                        'multisite.template.loaders.filesystem.Loader',\n                        'django.template.loaders.app_directories.Loader',\n                    )\n                }\n                ...\n            }\n            ...\n        ]\n\n   * For other settings (cache, etc.) check the `django-multisite \u003chttps://github.com/ecometrica/django-multisite\u003e`_ page\n\n#. Add ``multisite.middleware.DynamicSiteMiddleware`` and ``djangocms_multisite.middleware.CMSMultiSiteMiddleware`` to ``MIDDLEWARE_CLASSES``. The order is important: ``multisite.middleware.DynamicSiteMiddleware`` must be applied before ``cms.middleware.utils.ApphookReloadMiddleware``, while ``djangocms_multisite.middleware.CMSMultiSiteMiddleware`` must be right after::\n\n    MIDDLEWARE_CLASSES = [\n        ...\n        'multisite.middleware.DynamicSiteMiddleware',\n        'cms.middleware.utils.ApphookReloadMiddleware',\n        'djangocms_multisite.middleware.CMSMultiSiteMiddleware',\n        ...\n    ]\n\n#. Configure the URL mapping as follows. The `tests.test_utils.urls1` path can be the main urlconf file that you already have in your project. And it can be the same for all the domains if you need the same structure.::\n\n    MULTISITE_CMS_URLS={\n        'www.example.com': 'tests.test_utils.urls1',\n        'www.example2.com': 'tests.test_utils.urls2',\n    }\n    MULTISITE_CMS_ALIASES={\n        'www.example.com': ('alias1.example.com', 'alias2.example.com',),\n        'www.example2.com': ('alias1.example2.com', 'alias2.example2.com',),\n    }\n    MULTISITE_CMS_FALLBACK='www.example.com'\n\n#. Run ``python manage.py makemigrations``\n\n#. Run ``python manage.py migrate`` to apply the `django-multisite \u003chttps://github.com/ecometrica/django-multisite\u003e`_ migrations\n\n\nSettings explanation\n====================\n\nMULTISITE_CMS_URLS\n^^^^^^^^^^^^^^^^^^\n\nDictionary (or OrderedDict) containing the mapping between the domain (as configured in django\n``sites``) and the corresponding urlconf.\n\nMULTISITE_CMS_FALLBACK\n^^^^^^^^^^^^^^^^^^^^^^\n\nThe default domain to load if any of the above does not match.\n\nMULTISITE_CMS_ALIASES\n^^^^^^^^^^^^^^^^^^^^^\n\nDictionary (or OrderedDict) containing the mapping between the domain (as configured in django\n``sites``) and a list of aliases. This is optional if all the aliases are configured as\n``django-multisite`` aliases\n\nTroubleshooting\n===============\n\n* Domains in ``MULTISITE_CMS_URLS`` must be the same created in your database (via the interface in ``Home › Sites › Sites``).\n\n\n\n.. |Gitter| image:: https://img.shields.io/badge/GITTER-join%20chat-brightgreen.svg?style=flat-square\n    :target: https://gitter.im/nephila/applications\n    :alt: Join the Gitter chat\n\n.. |PyPiVersion| image:: https://img.shields.io/pypi/v/djangocms-multisite.svg?style=flat-square\n    :target: https://pypi.python.org/pypi/djangocms-multisite\n    :alt: Latest PyPI version\n\n.. |PyVersion| image:: https://img.shields.io/pypi/pyversions/djangocms-multisite.svg?style=flat-square\n    :target: https://pypi.python.org/pypi/djangocms-multisite\n    :alt: Python versions\n\n.. |Status| image:: https://img.shields.io/travis/nephila/djangocms-multisite.svg?style=flat-square\n    :target: https://travis-ci.org/nephila/djangocms-multisite\n    :alt: Latest Travis CI build status\n\n.. |TestCoverage| image:: https://img.shields.io/coveralls/nephila/djangocms-multisite/master.svg?style=flat-square\n    :target: https://coveralls.io/r/nephila/djangocms-multisite?branch=master\n    :alt: Test coverage\n\n.. |TestCoveralls| image:: https://coveralls.io/repos/github/nephila/djangocms-multisite/badge.svg?branch=master\n    :target: https://coveralls.io/github/nephila/djangocms-multisite?branch=master\n    :alt: Test coverage\n\n.. |License| image:: https://img.shields.io/github/license/nephila/djangocms-multisite.svg?style=flat-square\n   :target: https://pypi.python.org/pypi/djangocms-multisite/\n    :alt: License\n\n.. |CodeClimate| image:: https://codeclimate.com/github/nephila/djangocms-multisite/badges/gpa.svg?style=flat-square\n   :target: https://codeclimate.com/github/nephila/djangocms-multisite\n   :alt: Code Climate\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnephila%2Fdjangocms-multisite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnephila%2Fdjangocms-multisite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnephila%2Fdjangocms-multisite/lists"}