Skip to main content

Adds undo/redo functionality to django CMS

Project description

pypi coverage PyPI - Python Version PyPI - Django Versions from Framework Classifiers PyPI - django CMS Versions from Framework Classifiers

django CMS History is an addon application to provide undo/redo functionality in django CMS, by maintaining content history.

Some of the functionality in this application was previously included in django CMS itself. However, it became apparent that some users did not want it, and some wanted functionality that worked differently.

In keeping with the django CMS philosophy of maintaining only core CMS functionality as part of the package itself, history management was removed from django CMS in version 3.4 and has been spun off into an independent application.

django CMS History has been rewritten from the ground up. It will continue to be developed. New functionality and improvements will be introduced in future releases.

preview.jpg

Contribute to this project and win rewards

Because this is an open-source project, we welcome everyone to get involved in the project and receive a reward for their contribution. Become part of a fantastic community and help us make django CMS the best CMS in the world.

We’ll be delighted to receive your feedback in the form of issues and pull requests. Before submitting your pull request, please review our contribution guidelines.

We’re grateful to all contributors who have helped create and maintain this package. Contributors are listed at the contributors section.

Documentation

Version support

djangocms-history 3.x supports Python 3.9 through 3.13, Django 4.2, 5.2, 6.0 and 6.1, and django CMS 4.1, 5.0 and 5.1. If you are using django CMS 3.x, use djangocms-history 2.x.

The supported Python, Django and django CMS versions are shown by the badges at the top of this page (latest release read directly from the published PyPI classifiers). The latest supported versions of the master branch are declared in pyproject.toml; the tested combinations are defined in tox.ini and tests/requirements.

Installation

For a manual install:

  • run pip install djangocms-history

  • add djangocms_history to your INSTALLED_APPS

  • run python manage.py migrate djangocms_history

Configuration

Once installed, django CMS History will make new options available to the web content manager. These will be visible in the django CMS toolbar when managing content that is supported by the application.

In-place updates

On django CMS 5.1 and later, undo and redo update the structure board in place (through the data bridge the endpoints return), preserving scroll position and board state. On earlier versions the page is reloaded after each undo/redo instead.

History scope and limitations

History records plugin operations rather than arbitrary model or page changes. Undo/redo is available for the last 24 hours and for one content origin per user session. Editing another page supersedes the previous page’s history; another user’s edit supersedes history only when it affects the same content. Changing a plugin with a many-to-many relation clears the history for that content because the change cannot be restored reliably.

Operations older than 24 hours are ignored, but age alone does not immediately delete or archive their database rows. Superseded operations and operations from an earlier login session are retired when the corresponding cleanup path runs.

Retiring operations: archive or delete

By default retired operations are deleted outright. If you would rather retain them for inspection, enable archiving:

DJANGOCMS_HISTORY_ARCHIVE_OPERATIONS = True

Archived operations are flagged with is_archived=True and are still never used by undo/redo. They are not durable audit records: deleting related users, placeholders or other referenced content may delete them through database cascades. To remove archived operations later and reclaim database space, run:

python manage.py purge_archived_operations

The command supports --days N (only purge archived operations older than N days) and --dry-run (report what would be deleted without deleting).

djangocms-versioning

When djangocms-versioning is installed, undo/redo only operates on content that is editable, i.e. on draft versions. Once a version has been published, operations recorded on its draft can no longer be undone or redone; the toolbar buttons are disabled and the endpoints refuse to modify the published content.

Running Tests

The test suite uses pytest (with pytest-django). You can run tests by executing:

python -m venv env
source env/bin/activate
pip install -r tests/requirements/dj52_cms50.txt -e .
pytest

Run with djangocms-versioning installed:

pip install djangocms-versioning
VERSIONING=1 pytest

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djangocms_history-3.0.0.tar.gz (49.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

djangocms_history-3.0.0-py3-none-any.whl (47.9 kB view details)

Uploaded Python 3

File details

Details for the file djangocms_history-3.0.0.tar.gz.

File metadata

  • Download URL: djangocms_history-3.0.0.tar.gz
  • Upload date:
  • Size: 49.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for djangocms_history-3.0.0.tar.gz
Algorithm Hash digest
SHA256 229d5fabd7633d3a7c779e1928a4f37a862d3b9162ad705edfeb8b9d2eeb2c18
MD5 c793a2030cabacdc1d62dab87eb5da89
BLAKE2b-256 85d66164394e269902e2fe8a64192d94e89d3598e4bae5e9cfc4c3647a20d1ca

See more details on using hashes here.

File details

Details for the file djangocms_history-3.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for djangocms_history-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 722125d1b4da39ced7190806e847b7a271bf94f40ee31f7bc5126a29cbe385f7
MD5 8bdca18d5c320730d47ef2e19b930f51
BLAKE2b-256 38e5aece1cd90af8a0a22c50c56cab464f1c2297c4ffda5c7f1293ec90b027ce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page