Skip to main content

Django Flatpages Extra 💅

A drop-in replacement for Django's contrib.flatpages with extra 💅 features.

Features

  • Drop-in replacement: installing the app only requires 2 line changes, and optionally a management command.
  • Non-destructive: no flatpage data is lost if you uninstall it.
  • Revisions: direct edits to a page's content are forbidden in favor of creating page revisions.
  • Better history: every revision has a detailed description, and a diff view to see exactly what changed.
  • Previews: revisions can be previewed before they're published, and even shared via a private URL.
  • 1-click revert: once published, revisions can be reverted via a single click.

Compatibility

flatpages_extra should compatible with all curently supported versions of Python and Django.

Installation

First make sure the package is installed:

uv add django-flatpages-extra

Or if you're using pip:

pip install django-flatpages-extra

Then add flatpages_extra to your settings.INSTALLED_APPS, making sure it comes before contrib.flatpages:

# settings.py
INSTALLED_APPS = [
    ...
    "flatpages_extra",
    "contrib.flatpages",
    ...
]

Finally, include the URL configuration. The exact path doesn't matter as long as it's reachable somewhere:

# urls.py
urlpatters = [
    ...
    # Replace `flatpagesextra` with whatever you'd like:
    path("flatpagesextra/", include("flatpages_extra.urls")),
    ...
]

Once you've done all that, the app should be installed and running. Optionally you can run this command to import data from contrib.flatpages:

python manage.py flatpages_extra_import_initial

Running this command will do the following:

  • create initial Revisions for all existing flatpages;
  • copy the pages' history from contrib.flatpages (otherwise the "History" page in the admin would be empty);
  • copy any custom FlatPage permission;
  • copy user and group permissions.

How to use it

flatpages_extra is meant to be used from the Django admin. Once installed, it replaces Django's contrib.flatpages in the admin interface with its own (look for its signature 💅 emoji).

When you want to make changes to an existing page, create a new revision (the FlatPage change form will prompt you to do so).

Once a revision is created, you can make changes to it, preview it, and even share the preview link.

When you're happy with the changes, you can publish the revision via the "publish" button on the Revision changelist.

Publishing a revision will automatically update the related page's content and create a descriptive entry in that page's history.

Configuration

flatpages_extra does not currently have any configurable options at the moment.

How it works

flatpages_extra works by creating a proxy model to Django's original FlatPage, which lets us change how the model works in the admin while keeping the same database table. It also adds a new Revision model that lets us preview, revert, and track changes to flat pages. Both of those models are registered in the admin and will replace the original contrib.flatpages admin pages.

Release files for django-flatpages-extra 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-extra 1.0
File Size Uploaded
django_flatpages_extra-1.0.tar.gz 13.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-flatpages-extra 1.0
File Interpreter ABI Platform
django_flatpages_extra-1.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.6 kB

Release files / django_flatpages_extra-1.0.tar.gz

Download URL django_flatpages_extra-1.0.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
60f7d27f08198426e56291a7d166bcba8f89ef988bca6f5128c477fa2ffd93e4
BLAKE2b-256 checksum
How to use checksums
bf703f773fdc90930f68b54c39700d64fd2918e1ea75af7b4c01a4e689e73a70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.13

Release files / django_flatpages_extra-1.0-py3-none-any.whl

Download URL django_flatpages_extra-1.0-py3-none-any.whl
Size 22.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f1120f543cccd73d94e2c31b70c4ab93898d890b7b619e64df9abf1d95cb68f
BLAKE2b-256 checksum
How to use checksums
bdc7937118efa9c1e9573fdcb476dcac697b30249c725a6e1b513f4e8566bd8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.13

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files

0.10.0

2 release files

0.9.0

2 release files

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