Skip to main content

django-multisite supporto for django CMS

Project description

django-multisite support for DjangoCMS

Join the Gitter chat Latest PyPI version Python versions Latest Travis CI build status Test coverage Test coverage Code Climate License


Supported Django versions:

  • Django 3.0
  • Django 2.2

Supported django CMS versions:

  • django CMS 3.7


  1. A virtualenv up and running
  2. DjangoCMS working


pip install djangocms-multisite


  1. Open your file

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

      TEMPLATES = [
              'DIRS': {...}
              'OPTIONS': {
                  'loaders': (
    • For other settings (cache, etc.) check the django-multisite page

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

  4. 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',
        '': ('', '',),
        '': ('', '',),
  5. Run python makemigrations

  6. 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).


0.3.1 (unreleased)

  • Fix history formatting preventing proper pypi release

0.3.0 (2020-07-05)

  • Add Django 2.2 / django CMS 3.7+ support
  • Drop older Django / django CMS versions

0.2.0 (2018-09-25)

  • Add Django 1.11 / django CMS 3.4+ support
  • Drop older Django / django CMS versions
  • Improve 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.

Files for djangocms-multisite, version 0.3.1
Filename, size File type Python version Upload date Hashes
Filename, size djangocms_multisite-0.3.1-py2.py3-none-any.whl (5.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size djangocms-multisite-0.3.1.tar.gz (7.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page