Graphing transitions

Render a graphical overview of your model transitions.

  1. Install graphviz support:
uv pip install django-fsm-2[graphviz]

or

uv pip install "graphviz>=0.4"
  1. Ensure django_fsm is in INSTALLED_APPS:
INSTALLED_APPS = (
    ...,
    'django_fsm',
    ...,
)
  1. 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