Skip to main content

django-multisite supporto for django CMS

Project description

Latest PyPI version Monthly downloads Python versions Latest Travis CI build status Test coverage Test coverage Code Climate

django-multisite support for django CMS

Supported Django versions:

  • Django 1.6

  • Django 1.7

  • Django 1.8

  • Django 1.9

Supported django CMS versions:

  • django CMS 3.*

Usage

  1. Configure django-multisite as documented upstream

  2. Use SITE_ID = SiteId(default=1) instead of the documented SITE_ID = SiteID()

  3. Add multisite, djangocms_multisite to INSTALLED_APPS:

    INSTALLED_APPS=[
        ...
        'multisite',
        'djangocms_multisite',
        ...
    ]
  4. Add multisite.middleware.DynamicSiteMiddleware and djangocms_multisite.middleware.CMSMultiSiteMiddleware to MIDDLEWARE_CLASSES; multisite.middleware.DynamicSiteMiddleware must be applied before cms.middleware.utils.ApphookReloadMiddleware, while djangocms_multisite.middleware.CMSMultiSiteMiddleware must right after that:

    MIDDLEWARE_CLASSES = [
        ...
        'multisite.middleware.DynamicSiteMiddleware',
        'cms.middleware.utils.ApphookReloadMiddleware',
        'djangocms_multisite.middleware.CMSMultiSiteMiddleware',
        ...
    ]
  5. Configure the URL mapping as follows:

    MULTISITE_CMS_URLS={
        'www.example.com': 'tests.test_utils.urls1',
        'www.example2.com': 'tests.test_utils.urls2',
    },
    MULTISITE_CMS_ALIASES={
        'www.example.com': ('alias1.example.com', 'alias2.example.com',),
        'www.example2.com': ('alias1.example2.com', 'alias2.example2.com',),
    },
    MULTISITE_CMS_FALLBACK='www.example.com'
  6. Run python manage.py migrate

Settings

MULTISITE_CMS_URLS

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

MULTISITE_CMS_FALLBACK

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

MULTISITE_CMS_ALIASES

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

History

0.1.1 (2016-11-07)
  • Improved host selection

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.

Source Distribution

djangocms-multisite-0.1.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

djangocms_multisite-0.1.1-py2.py3-none-any.whl (6.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file djangocms-multisite-0.1.1.tar.gz.

File metadata

File hashes

Hashes for djangocms-multisite-0.1.1.tar.gz
Algorithm Hash digest
SHA256 88abc0635f52a5762a11394bbae52beda0b975cf257f70186cd44179b84e26fa
MD5 5918abd3bcc52c7bc3c37f6421e026ba
BLAKE2b-256 1495aaefd773e5cd898bab43941920f086256de3647593c4f380dad07af783a0

See more details on using hashes here.

File details

Details for the file djangocms_multisite-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for djangocms_multisite-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 75da9466b65b2338cc12d2a31b8434e53431d248669f81b2a22a2f43675f5ce7
MD5 f667540dfcaae81a9ff5cee2ee4efa4c
BLAKE2b-256 dacd3e35f3533103811f020dd4cc7bc8e276a7b37373e47fca62cbbe77c2460b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page