Skip to main content

django-multisite supporto for django CMS

Project description


`django-multisite <>`_ support for DjangoCMS

|Gitter| |PyPiVersion| |PyVersion| |Status| |TestCoverage| |CodeClimate| |License|


Supported *Django* versions:

* Django 1.11

Supported django CMS versions:

* django CMS 3.4
* django CMS 3.5


#. A virtualenv up and runnign
#. DjangoCMS working


``pip install djangocms-multisite``


#. Open your ```` file

#. We need to add the configurations for `django-multisite <>`_ :

* Replace SITE_ID value with the SiteID function::

from multisite import SiteID
SITE_ID = SiteID(default=1)

* Add ``multisite``, ``djangocms_multisite`` to ``INSTALLED_APPS``::

* Add those loders in the TEMPLATES setting::

'DIRS': {...}
'loaders': (

* For other settings (cache, etc.) check the `django-multisite <>`_ page

#. 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::


#. 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.::

'': 'tests.test_utils.urls1',
'': 'tests.test_utils.urls2',
'': ('', '',),
'': ('', '',),

#. Run ``python makemigrations``

#. Run ``python migrate`` to apply the `django-multisite <>`_ migrations

Settings explanation


Dictionary (or OrderedDict) containing the mapping between the domain (as configured in django
``sites``) and the corresponding urlconf.


The default domain to load if any of the above does not match.


Dictionary (or OrderedDict) containing the mapping between the domain (as configured in django
``sites``) and a list of aliases. This is optional if all the aliases are configured as
``django-multisite`` aliases


* Domains in ``MULTISITE_CMS_URLS`` must be the same created in your database (via the interface in ``Home › Sites › Sites``).

.. |Gitter| image::
:alt: Join the Gitter chat

.. |PyPiVersion| image::
:alt: Latest PyPI version

.. |PyVersion| image::
:alt: Python versions

.. |Status| image::
:alt: Latest Travis CI build status

.. |TestCoverage| image::
:alt: Test coverage

.. |License| image::
:alt: License

.. |CodeClimate| image::
:alt: Code Climate


0.2.0 (unreleased)

* Django 1.11 / django CMS 3.4+ support
* Dropped older Django / django CMS versions
* Improved documentation

0.1.0 (unreleased)

* First experimental release

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
djangocms_multisite-0.2.0-py2.py3-none-any.whl (8.1 kB) Copy SHA256 hash SHA256 Wheel py2.py3
djangocms-multisite-0.2.0.tar.gz (6.9 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page