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
Install python library using pip: pip install django-flatpages-i18n
Add mptt, modeltranslation and flatpages_i18n to INSTALLED_APPS in your Django settings file
Add flatpages_i18n.middleware.FlatpageFallbackMiddleware to MIDDLEWARE_CLASSES in your Django settings file
Specify desired languages in your Django settings file:
from django.utils.translation import gettext LANGUAGE_CODE = 'en' LANGUAGES = ( ('en', gettext('English')), ('de', gettext('German')), )Migrate your database
Run sync_translation_fields and update_translation_fields commands (from modeltranslation app)
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 %}
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'.
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)
| 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)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 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.