Giter Club home page Giter Club logo

djangocms-multisite's Introduction

djangocms-multisite

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. In project urls.py:

    #. Add ``from djangocms_multisite.urlresolvers import cms_multisite_url``
    #. Change ``url(r'^', include('cms.urls')),`` to ``cms_multisite_url(r'^', include('cms.urls')),``
  7. 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

djangocms-multisite's People

Contributors

czpython avatar jedie avatar jqb avatar stefanfoulis avatar yakky avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.