Multisite support for feincms3
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file feincms3-sites-0.3.0.tar.gz
.
File metadata
- Download URL: feincms3-sites-0.3.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86c6dac435a321a81bcda6ba374e29d3979743a015af9d1b4a40fb41f5098a93 |
|
MD5 | 2a4bff2b25490f333d924c9e978bb68c |
|
BLAKE2b-256 | 3c13aa1ac77fc3583803714b313426b4c65894d4abe143128d1ee9469b05035c |
File details
Details for the file feincms3_sites-0.3.0-py2.py3-none-any.whl
.
File metadata
- Download URL: feincms3_sites-0.3.0-py2.py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33ede4ba0f5f8c64b13a05b70aa646df13b5d66af1779ae942f87c51adf9e247 |
|
MD5 | 686908167c92a4c62d227cc93d696eb3 |
|
BLAKE2b-256 | d4d67fb2d459b55a50d979001b454028134899292451ff836a0e99f042c3868e |