Skip to main content

Django Flatpage Extensions

An extension to django.contrib.flatpages to provide

  • Better support for markdown and other similar markup formats. We provide support for Markdown but you can write your own parser to support rst or creole.

  • Optional support for the excellent markItUp jquery editor. This requires the installation django-markitup.

  • Easy inclusion of images in flatpages. Viewing Admin image thumbnails requires the installation of sorl-thumbnail.

  • The inclusion of HTML metatags such as keywords and descriptions in flatpages.

  • Content revisions.

Migrating you data to flapages_x should not be difficult since the data which currently in the contrib.Flatpage model (content, titles) is not affected. Your templates will still utilize the {{flatpage.content}} and {{flatpage.body}} context variables. Once you install flatpages_x, the Markdown is actually stored in the related Revisions model. When you save a flatpage, this will be rendered as html via the markdown parser and saved to the Flatpage.content field

Contributors

Quickstart

Create a virtual environment for your project and activate it:

$ virtualenv mysite-env
$ source mysite-env/bin/activate
(mysite-env)$

Next install flatpages_x

(mysite-env)$ pip install django-flatpages-x

Add flatpages_x to your INSTALLED_APPS setting.

Inside your project run:

(mysite-env)$ python manage.py syncdb

Django-flatpages-x comes with support for Markdown You can also associate and display images with your flatpages. To include your images in your content using reference-style image syntax looks like this

![Atl text][image.pk]

Where [image.pk] is the primary key of image the that you want to include. The primary key of the image should is visible in the flatpages Admin form which will now contains an inline image form

markItUp support

If you want to use the excellent markItUp! editor widget. Install django-markItUp:

(mysite-env)$ pip install django-markitup

You need a few configuration steps

  1. Add ‘markitup’ to your INSTALLED_APPS setting.

  2. Add the following to settings:

    MARKITUP_SET = 'markitup/sets/markdown'
    MARKITUP_SKIN = 'markitup/skins/markitup'
    MARKITUP_FILTER = ('markdown.markdown', {'safe_mode': True})
  3. You need to use the AJAX-based preview for the admin widget:

    url(r'^markitup/', include('markitup.urls'))

in your root URLconf.

Admin thumbnails

If you want view admin image thumbnails install sorl-thumbnail:

(mysite-env)$ pip install sorl-thumbnail
  1. Add sorl.thumbnail to your settings.INSTALLED_APPS.

  2. Configure your settings

  3. If you are using the cached database key value store you need to sync the database:

    python manage.py syncdb

Markup Support

Django-flatpages-x come with a simple parser that supports Markdown. However, you can supply your own parser by setting the value for FLATPAGES_X_PARSER to settings.py. So if you want to use a parser myparser_parser simply add the following to you settings

FLATPAGES_X_PARSER= ["flatpages_x.markdown_parser.parse", {}]

Documentation

See the full documentation for more details.

Metadata

Release files for django-flatpages-x 0.1.5

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-x 0.1.5
File Size Uploaded Provenance Actions
django-flatpages-x-0.1.5.tar.gz 187.2 kB Without provenance Details for django-flatpages-x-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-flatpages-x 0.1.5
File Interpreter ABI Platform Actions
django_flatpages_x-0.1.5-py2-none-any.whl Python 2 none any Details for django_flatpages_x-0.1.5-py2-none-any.whl

Total release size: 199.5 kB

Release files / django-flatpages-x-0.1.5.tar.gz

Download URL django-flatpages-x-0.1.5.tar.gz
Size 187.2 kB
Tags Source
SHA-256 checksum
How to use checksums
88b004a959f9179e9ce56a0e839c29d6d8a157ee95ec1776b99a0e5ed642fb4d
BLAKE2b-256 checksum
How to use checksums
521bb9b449ca638a08f522ebe89fa5cec3e453a16d036f4eb56422b6d071f58d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_flatpages_x-0.1.5-py2-none-any.whl

Download URL django_flatpages_x-0.1.5-py2-none-any.whl
Size 12.4 kB
Tags Python 2
SHA-256 checksum
How to use checksums
774c6213fd32362cebf9dfc88b90dba62d0a896907ac9d56cb9b0422e986aacb
BLAKE2b-256 checksum
How to use checksums
62eed92b6138fd2d256c616c671950a6dadf5dbf5b82595c87dcb9b7c8bdab50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-flatpages-x 0.1.5

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.

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