django-fsm-log
Transition's persistence for django-fsm
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-loguv
uv add django-fsm-logpoetry
poetry add django-fsm-logInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
django-fsm-2Adds declarative finite state machine support…
permissive · top 15,000 on PyPI
django-logentry-adminRegisters Django's built-in LogEntry model in…
permissive · top 15,000 on PyPI
django-fsmProvides finite state machine support for…
permissive · top 15,000 on PyPI
AutomatAutomat provides a Python library for building…
permissive · top 5,000 on PyPI
fysomFysom is a finite state machine library that…
permissive · top 15,000 on PyPI
django-dirtyfieldsTracks which fields on a Django model instance…
permissive · top 15,000 on PyPI
django-lifecycleAdds declarative lifecycle hooks to Django…
permissive · top 15,000 on PyPI
transitionsTransitions is a lightweight state machine…
permissive · top 5,000 on PyPI
python-statemachineDefines finite state machines and statecharts…
permissive · top 5,000 on PyPI
django-soft-deleteAdds soft deletion to Django models by marking…
permissive · top 15,000 on PyPI