Skip to main content

Multisite support for feincms3

Project description

CI Status

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

feincms3_language_sites-0.0.2.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

feincms3_language_sites-0.0.2-py3-none-any.whl (9.1 kB view hashes)

Uploaded Python 3

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