Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.

django-flatpages-i18n

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

Requirements

  • Django

  • django_modeltranslation

  • django_mptt

Tested with Django 1.8.

Installation

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

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

  3. Add flatpages_i18n.middleware.FlatpageFallbackMiddleware to MIDDLEWARE_CLASSES in your Django settings file

  4. Specify desired languages in your Django settings file:

    from django.utils.translation import gettext
    
    LANGUAGE_CODE = 'en'
    LANGUAGES = (
        ('en', gettext('English')),
        ('de', gettext('German')),
    )
  5. Migrate your database

  6. Run sync_translation_fields and update_translation_fields commands (from modeltranslation app)

  7. If you want to use Redactor WYSIWYG editor (see settings below), you need to add 'flatpages_i18n.urls' to your urls.py:

    if 'flatpages_i18n' in settings.INSTALLED_APPS:
        urlpatterns += i18n_patterns(
            url(r'^', include('flatpages_i18n.urls')),
        )

Usage

To get all flatpages:

In your HTML template:

{% load i18n flatpages_i18n %}

{% get_available_languages as LANGUAGES %}
{% get_flatpages_i18n as flatpages_i18n %}

<ul>
    {% for flatpage in flatpages_i18n %}
        <li><a href="/{{ LANGUAGE_CODE }}{{ flatpage.url }}">{{ flatpage.title }}</a></li>
    {% endfor %}
</ul>

To get flatpage by its PK:

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

or by its machine_name:

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

Menu system:

To print all menu items:

<div id="navigation">
    {% get_menu %}
</div>

to get only children of menu item identified by its PK:

<div id="navigation">
    {% get_menu 2 %}
</div>

or by its machine_name:

<div id="navigation">
    {% get_menu 'footer-menu' %}
</div>

Settings

FLATPAGES_EDITOR

If you wish to use Redactor as WYSIWYG editor, set it to 'REDACTOR'. Default: None.

FLATPAGES_REDACTOR_JS

Path to Redactor .js file. Default: 'js/redactor/redactor.js'.

FLATPAGES_REDACTOR_CSS

Path to Redactor .css file. Default: 'css/redactor/redactor.css'.

Authors

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

Metadata

Release files for django-flatpages-multilanguage 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-flatpages-multilanguage 0.1.0
File Size Uploaded Provenance Actions
django-flatpages-multilanguage-0.1.0.tar.gz 102.2 kB Without provenance Details for django-flatpages-multilanguage-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-flatpages-multilanguage 0.1.0
File Interpreter ABI Platform Actions
django_flatpages_multilanguage-0.1.0-py3-none-any.whl Python 3 none any Details for django_flatpages_multilanguage-0.1.0-py3-none-any.whl

Total release size: 208.3 kB

Release files / django-flatpages-multilanguage-0.1.0.tar.gz

Download URL django-flatpages-multilanguage-0.1.0.tar.gz
Size 102.2 kB
Tags Source
SHA-256 checksum
How to use checksums
52fd7c5e24c73357fe039f0bb71c40b674b74c3d87af331f23ad643175e5cfdd
BLAKE2b-256 checksum
How to use checksums
48dc884771158ca2e0f5e4f2c771ef183ff07446060e38035906b3cfe7e2a870
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8

Release files / django_flatpages_multilanguage-0.1.0-py3-none-any.whl

Download URL django_flatpages_multilanguage-0.1.0-py3-none-any.whl
Size 106.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2544ce1820590708b79b11de379fc72e9a67dca2c7ce548539c02b015bf02c6e
BLAKE2b-256 checksum
How to use checksums
fb3be12fc2345de2a5f8a6ccedbc8caa97cbdf72ffa82a015707e6043dcd5e36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8

Security for django-flatpages-multilanguage 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page