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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f64169b7b68a63828bd7c59ec11316fcecef6d4fbc7c8fecc4c96220dac2a7d2 |
|
MD5 | 7d76c98c0465aca42d14da503c86516d |
|
BLAKE2b-256 | 87066cfbbe861607286b41a07ee82ab68a7c6ec4a4c6f8b85e61696e1d49292a |
Hashes for feincms3_language_sites-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3a8d421b37864e9a65c8410b41d049749a0e50420e6542f32ea41b7d5035594 |
|
MD5 | f6ce5720273e40dadef14a1ea6f855be |
|
BLAKE2b-256 | f565495f0bc297a1fc32c1fc10414581c8f45e6d70f8587ed62b0ebe824b0ea6 |