Skip to main content

HTML editor on django.contrib.flatpages

Project description


django-flatpages-tinymce provides on-site editing of “Flat Pages” with minimal impact on the rest of code.

django-flatpages-tinymce is available under the MIT license.


First of all, you need to have django-flatpages-tinymce and django-tinymce installed; for your convenience, recent versions should be available from PyPI.

To use, just add these applications to your INSTALLED_APPS after django.contrib.flatpages app:


If you want on-site editing of templates, you must edit flatpages templates: change {{flatpage.content} to {% flatpage_admin flatpage %} from flatpage_admin template library. So

{% extends "base.html" %}
{% block body %}
{% endblock %}
{% block body %}
{% endblock %}

will become

{% extends "base.html" %}
{% load flatpage_admin %}
{% block body %}
{% flatpage_admin flatpage %]
{% endblock %}

If you are bothered with <script>/<link> tags, being inserted in <body> tag and your template has something like {% block extrahead %}, you can move all plugin media in head, using {% flatpage_media %} tag.

{% extends "base.html" %}
{% block extrahead %}
{% flatpage_media %}
{% endblock %}
{% block body %}
{% flatpage_admin flatpage %}
{% endblock %}


Default settings are in file. Also, you can override them in site-wide file. The main of them are:

  • FLATPAGES_TINYMCE_ADMIN (default True) - use TinyMCE widget in admin area
  • FLATPAGES_TINYMCE_FRONTEND (default True) - use TinyMCE widget in frontend
  • FLATPAGES_TEMPLATE_DIR (default: TEMPLATE_DIRS[0] + ‘flatpages’) - directory where flatpages templates are placed
  • FLATPAGES USE_MINIFIED (defalut: not settings.DEBUG) - use minified versions of JS/CSS

Further, you will want to change default settings of TinyMCE Editor.

    # custom plugins
    'plugins': "table,spellchecker,paste,searchreplace",
    # editor theme
    'theme': "advanced",
    # custom CSS file for styling editor area
    'content_css': MEDIA_URL + "css/custom_tinymce.css",
    # use absolute urls when inserting links/images
    'relative_urls': False,


Changes in version 0.1.1

  • Minor issues with IE8.0.

Changes in version 0.1

  • First public release.

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-tinymce, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size (17.0 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 Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page