Skip to main content

Multisite support for feincms3

Project description

https://travis-ci.org/matthiask/feincms3-sites.svg?branch=master

Multisite support for feincms3.

This app allows running a feincms3 site on several domains, with separate page trees etc. on each (if so desired).

The default behavior allows to match a single host. The advanced options fieldset in the administration panel allows specifying your own regex, which is matched against the host. There can be at most one default site.

Installation and usage

  • pip install feincms3-sites

  • Add feincms3_sites to INSTALLED_APPS and run ./manage.py migrate

  • Your page model should extend feincms3_sites.models.AbstractPage instead of feincms3.pages.AbstractPage. The only difference is that our AbstractPage has an additional site foreign key, and path uniqueness is enforced per-site.

  • If you’re using feincms3 apps currently, replace feincms3.apps.apps_middleware with feincms3_sites.middleware.apps_middleware in your MIDDLEWARE. Otherwise, you may want to add feincms3_sites.middleware.site_middleware near the top.

  • Uses of apps_urlconf() in your own code (improbable!) have to be replaced by feincms3_sites.middleware.apps_urlconf_for_site(site).

  • Page.objects.active() does not automatically filter by site, you’ll have to do this yourself in your views code, navigation template tags etc. The site instance (if any could be found) is always available as request.site.

  • If you want to automatically redirect requests to the current site, insert feincms3_sites.middleware.redirect_to_site_middleware after one of the other middleware referenced above. You may also set SecurityMiddleware’s SECURE_SSL_REDIRECT = True to enforce SSL. In this case, insert redirect_to_site_middleware before the SecurityMiddleware.

  • It is possible to define a default language per site. If this sounds useful to you, replace django.middleware.locale.LocaleMiddleware with feincms3_sites.middleware.default_language_middleware.

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

feincms3-sites-0.4.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

feincms3_sites-0.4.1-py2.py3-none-any.whl (12.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file feincms3-sites-0.4.1.tar.gz.

File metadata

File hashes

Hashes for feincms3-sites-0.4.1.tar.gz
Algorithm Hash digest
SHA256 0243c7b1fe0e93fb59698f54dffaa4b99b90e9055b2992cedd82740bf2f2d63f
MD5 a9388c8eeb983cd2d0388300ca3cd613
BLAKE2b-256 f250cd7e2086109e0cfcc84a43b1f6fa93b19e7d9f81d6f75b91065e3397f6de

See more details on using hashes here.

File details

Details for the file feincms3_sites-0.4.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for feincms3_sites-0.4.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ce1ecd9c9a24ff66881de7d2c98231ebe6c9c3052455fc07f6c8d562b33098f0
MD5 1407a8e6a103f7a0957b90a0bb203572
BLAKE2b-256 c35166ee125311d95787a227661d66ca90edd3c556547bcfc8814ada51d5185f

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