Skip to main content

Django Workflow Engine

django-workflow-engine is a lightweight and reusable workflow engine for Django applications. It enables you to better organise the business logic for collaborating users.

Installation

pip install django-workflow-engine

Getting started

Add the application to your Django settings INSTALLED_APPS list:

INSTALLED_APPS = [
    ...
    "django_workflow_engine",
]

Add the built-in django-workflow-engine view urls to your project's urls.py as follows:

from django_workflow_engine import workflow_urls
...
urlpatterns = [
    path("workflow/", workflow_urls()),
    ...
]

This will utilise all django-workflow-engine built-in view classes. Default views are:

  • list_view=FlowListView List of workflow instances view.
  • view=FlowView Workflow instance view.
  • create_view=FlowCreateView Create workflow view.
  • continue_view=FlowContinueView Workflow continuation view.
  • diagram_view=FlowDiagramView Workflow diagram view.

You can override any the built-in view classes with your own, for example to provide your own view classes for flow list and flow view:

urlpatterns = [
        path("workflow/",
             workflow_urls(
                 list_view=MyFlowListView,
                 view=MyFlowView,
            ),
        ),
    ]

Building your first workflow

Create a workflows.py in your project and add your uniquely named workflows.

from django_workflow_engine import Step, Workflow

onboard_contractor = Workflow(
    name="onboard_contractor",
    steps=[
        Step(...),
        Step(...),
        Step(...),
    ],
)

onboard_perm = Workflow(
    name="onboard_perm",
    steps=[
        ...
    ],
)

Add you workflows to your Django settings as follows:

DJANGO_WORKFLOWS = {
    "onboard_contractor": "your_app.workflows.onboard_contractor",
    "onboard_perm": "your_app.workflows.onboard_perm",
}

Each entry needs to be a valid module path where the final component is the name of your workflow class.

Finally, run the django-workflow-engine migrations:

$ ./manage.py migrate

Metadata

Release files for django-workflow-engine 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-workflow-engine 0.2.2
File Size Uploaded Provenance
django_workflow_engine-0.2.2.tar.gz 21.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-workflow-engine 0.2.2
File Interpreter ABI Platform
django_workflow_engine-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 61.9 kB

Release files / django_workflow_engine-0.2.2.tar.gz

Download URL django_workflow_engine-0.2.2.tar.gz
Size 21.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4bb14dd3d26f15c723f25904e47f212066ebba132c71548093a6cc26551af580
BLAKE2b-256 checksum
How to use checksums
890ab36b66b713530b9f6d4abbfe346388f3c69126583500c6520cc580ed5cea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0

Release files / django_workflow_engine-0.2.2-py3-none-any.whl

Download URL django_workflow_engine-0.2.2-py3-none-any.whl
Size 40.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
763559d0c1c7fc3280b729f8f9857b944c2baf518e223a1c747b272bb691d74c
BLAKE2b-256 checksum
How to use checksums
e9677eb7fb84909bf06e1cce63157fa8d7269abaf0446a720eea74f6d814a038
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0

Security for django-workflow-engine 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page