{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/12"}],"enrichment":{"capability":"Adds declarative finite state machine support to Django models, letting you define state transitions once with decorators instead of managing state values manually throughout your code.","skillfed_tags":["django-plugin","state-machine","workflow"],"use_cases":["Managing blog post lifecycle (draft \u2192 review \u2192 published \u2192 archived) with automatic permission and timing checks.","Enforcing order state workflows (pending \u2192 processing \u2192 shipped \u2192 delivered) with side effects like notifications.","Controlling document approval flows where transitions require specific user permissions and conditions.","Building task or ticket systems where state changes trigger notifications or log entries.","Implementing subscription or account status transitions with business logic tied to each change."],"what_it_does":"Django FSM-2 is a maintained fork of the archived Django FSM project that brings finite state machine patterns to Django models. Instead of storing state as a plain CharField and managing transitions scattered throughout your codebase, you declare states and transitions once using decorators on model methods. This centralizes your model's lifecycle logic in one place, making it easier to reason about valid state changes, enforce preconditions, and attach business logic (side effects, permissions, notifications) to specific transitions.\n\nThe package works by providing FSMField (or FSMIntegerField/FSMKeyField variants) to store state, the @transition decorator to define allowed state changes, and helper methods to check permissions and available transitions. Transition methods can contain arbitrary logic; the state changes in memory on success, and you persist it with save(). You can restrict transitions with conditions, attach permissions, specify error-handling states, and use dynamic target states based on method return values.","worth_installing":"Yes. This is a well-maintained, actively developed fork of a proven library with no known vulnerabilities, low install friction, and clear production-stable status. Use it if you need to manage model state transitions declaratively in Django; it eliminates scattered state-management code and makes workflows explicit and testable."},"id":"django-fsm-2","links":{"html":"https://skillfed.io/packages/django-fsm-2","md":"https://skillfed.io/packages/django-fsm-2.md","pypi":"https://pypi.org/project/django-fsm-2/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-03-16","license_spdx":"MIT","license_treatment":"permissive","name":"django-fsm-2","python_support":"supports_current","summary":"Django friendly finite state machine support."},"popularity":{"monthly_downloads":437224,"position":6671,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"4.2.4"}
