Graphing transitions
Render a graphical overview of your model transitions.
- Install graphviz support:
uv pip install django-fsm-2[graphviz]
or
uv pip install "graphviz>=0.4"
- Ensure
django_fsmis inINSTALLED_APPS:
INSTALLED_APPS = (
...,
'django_fsm',
...,
)
- Run the management command:
# Create a dot file
./manage.py graph_transitions > transitions.dot
# Create a PNG image file for a specific model
./manage.py graph_transitions -o blog_transitions.png myapp.Blog
# Exclude some transitions
./manage.py graph_transitions -e transition_1,transition_2 myapp.Blog