Multisite support for feincms3
Project description
Multisite support for feincms3.
Extend feincms3_language_sites.models.AbstractPage instead of feincms3.pages.AbstractPage. This abstract page already extends feincms3.mixins.LanguageAndTranslationOfMixin so you do not have to use the mixins adding a language field to the page.
Replace the LocaleMiddleware with feincms3_language_sites.middleware.site_middleware
Optionally add feincms3_language_sites.middleware.redirect_to_site_middleware if you want to enforce the host. The SECURE_SSL_REDIRECT is also respected. The redirect_to_site_middleware has to be added before the SecurityMiddleware to work correctly.
Add some configuration for feincms3-language-sites
Possible configuration:
SITES = {
"de": {
"host": "127.0.0.1:8000",
"host_re": r"example\.com$|127.0.0.1:8000$",
},
"fr": {
"host": "localhost:8000",
},
}
Note that Page.objects.active() only returns pages in the current language. If you want to generate translation links (e.g. using ...|translations in a template) you do not want to use the .active() queryset method but build something yourself which runs .filter(is_active=True).
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
Hashes for feincms3_language_sites-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bf0d38ef97e9c820b7cc2730c09c4803ccf9790d2122cc9d2ec52fab0dbc001 |
|
MD5 | 979ade2a692de2438295adb2e392809b |
|
BLAKE2b-256 | 4ac58e38d995f52acd5fee09e89d7e704987aa28095c95d46be2ddd7814da156 |
Hashes for feincms3_language_sites-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6eef7c010981c03c876d422d44ef9e2a3aa8c63d6388330171d221ed7cae7710 |
|
MD5 | c918bd27855053e05add7268bcf81c5c |
|
BLAKE2b-256 | 1399319abdadc25c03b3869fdcea183adf37ab4c4eca51b76509b69a4afb5694 |