Getting Started

  1. Install and enable it

    pip install django-river
  1. Create your first state machine in your model

    from django.db import models
    from river.models.fields.state import StateField
    class MyModel(models.Model):
        my_state_field = StateField()
  1. Create your states as one of them will be your initial state on the admin page (Look at State Administration.)

  2. Create your transition approval metadata with your model (MyModel - my_state_field) information and authorization rules along with their priority on the admin page (Look at Transition Approval Meta Administration.)

  3. Enjoy your django-river journey.

    # and much more. Check the documentation


Whenever a model object is saved, it’s state field will be initialized with the state is given at step-3 above by django-river.


Make sure that there is only one initial state defined in your workflow, so that django-river can pick that one automatically when a model object is created. All other workflow items will be managed by django-river after object creations.