skillfed

django-fsm-log

Transition's persistence for django-fsm

django-fsm-log v5.0.2 130.9K downloads/30d#11,620 on PyPI248
Permissive license MIT Active released

What it is and what it does

django-fsm-log is a Django app that automatically captures and persists state machine transitions for models using django-fsm-2. It listens for FSM transition signals and creates database records for each state change, including source state, target state, timestamp, and optional metadata like the user who triggered the transition.

The package provides query helpers (StateLog.objects.for_() to filter by model instance), decorators to attach user information or custom descriptions to transitions, and admin integration to visualize transition history. It can optionally cache pending transitions before they're persisted, allowing access to log details immediately after a transition begins rather than waiting for database commit.

Use it for:

  • Track approval workflows in document management systems, logging who approved/rejected and when.
  • Audit state changes in order processing pipelines for compliance and debugging.
  • Display transition history in Django admin to show users how a model's state evolved.
  • Implement rollback or undo features by querying the StateLog to find previous states.
  • Generate reports on transition timing and frequency to identify bottlenecks in workflows.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Automatically logs state transitions for Django FSM models to the database, capturing the source state, target state, timestamp, and optional metadata like the user who triggered the transition.

Yes. The package is actively maintained, supports current Django and Python versions, has no known vulnerabilities, and solves a common need for FSM-based Django applications. Install it if you're using django-fsm-2 and need to audit or display state transition history; the low install friction and permissive license make it a straightforward addition.

Install

django-fsm-log on PyPI

pip

pip install django-fsm-log

uv

uv add django-fsm-log

poetry

poetry add django-fsm-log

Installing django-fsm-log

Before you install

Low friction installation with three straightforward dependencies (django, django-fsm-2, django-appconf). The package is actively maintained with recent releases supporting modern Django versions (5.2, 6.0) and Python 3.14, indicating ongoing compatibility work.

License in practice

MIT license is permissive, allowing use in commercial and open-source projects with minimal restrictions—only requiring attribution.

Quickstart

pip install django-fsm-log

# Add to INSTALLED_APPS
INSTALLED_APPS = (..., 'django_fsm_log', ...)

# Run migrations
python manage.py migrate django_fsm_log

# Query logs
from django_fsm_log.models import StateLog
StateLog.objects.all()

Requires an existing Django project with django-fsm-2 already configured; the package listens for django_fsm.signals.post_transition, so FSM models must be set up first.

Verify before relying

  • Whether the cached backend feature (CachedBackend) is suitable for high-concurrency scenarios or has known limitations.
  • Performance impact when logging transitions for models with very high transition frequency.
  • Whether the admin integration (StateLogInline) works with all Django admin customizations.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 3 — django-appconf, django-fsm-2, django
Maintenance actively maintained — 199 days since the last release
Last repo commit
First released
Downloads 130,904/month — #11,620 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_fsm_log-5.0.2-py3-none-any.whl

Keywords: django, django-fsm-2

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python Modules

Tags

django fsm loggingstate machine transition historydjango workflow audit trailfsm state change trackingdjango model state logtransition persistence django
django-ormaudit-trailstate-machine

More Python Modules packages