Skip to main content

Translatable flatpages

Project description

Translatable version of django.contrib.flatpages with menu support.


  • Django
  • django_modeltrans
  • django_mptt

Tested with Django 1.8.


  1. Install python library using pip: pip install django-flatpages-i18n

  2. Add mptt, modeltrans and flatpages_i18n to INSTALLED_APPS in your Django settings file

  3. Migrate your database

  4. Specify desired languages in your Django settings file:

    from django.utils.translation import gettext
    LANGUAGE_CODE = 'en'
        ('en', gettext('English')),
        ('de', gettext('German')),
  5. Addd 'flatpages_i18n.urls' to your

    if 'flatpages_i18n' in settings.INSTALLED_APPS:
        urlpatterns += i18n_patterns(
            path(pgettext_lazy('url', 'pages/'), include('flatpages_i18n.urls')),


To get all flatpages:

In your HTML template:

{% load i18n flatpages_i18n %}
{% get_flatpages_i18n as flatpages_i18n %}

    {% for flatpage in flatpages_i18n %}
        <li><a href="{{ flatpage.get_absolute_url }}">{{ flatpage }}</a></li>
    {% endfor %}

To get flatpage by its PK:

{% get_flatpage_i18n 123 as my_flatpage %}
{{ my_flatpage.content_i18n }}

or by its machine_name:

{% get_flatpage_i18n 'my-flatpage' as my_flatpage %}


Library is by Erik Telepovsky from Pragmatic Mates. See our other libraries.

Project details

Download files

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

Files for django-flatpages-i18n, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size django-flatpages-i18n-1.0.0.tar.gz (8.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page