Skip to main content

Reusable library to build business applications fast

Project description


The Django extension for perfectionists with yesterday’s deadlines.

Viewflow is a reusable library that makes it easy to build business applications fast. Viewflow helps to implement collaboration and approval workflows, CRUD, and reporting.

The goal of Viewflow to stay small, flexible, and let you create Django applications as quickly as with no-code solutions.

Viewflow has a pre-built UI and assumes that you can implement your own.

travis-svg requirements-svg pypi-version py-versions

Viewflow comes in two flavors:

  • Open-source library with only non-opinionated core classes that allows you to build your custom solution on top.
  • PRO: Reference functionality implementation. Integrated with third-party Django packages included.


Viewflow works with Python 3.7 or greater and Django 3.2+


pip install django-viewflow --pre


pip install django-viewflow-pro  --extra-index-url<licence_id>/simple/ --pre


You can get a bare minimum, pre-configured Django project with Viewflow enabled with the following command:

npm init django project_name --viewflow

just replace "project_name" with the desired name of your application module.




Samples applications code for Viewflow PRO available at:


BPMN Workflow

viewflow.workflow.* is a lightweight workflow layer on top of Django's Model-View-Template that helps to organize people's collaboration business logic.


The workflow layer separates collaboration logic from the views code.

def approve_task(request, process_pk, task_pk):
     form = ApproveForm(request.POST or None)
     if form.is_valid():
         request.activation.done()  # <- complete workflow task
         return redirect('/')
     return render(request, {
         'activation': request.activation,
         'form': form,

Viewflow supports parallel activities, allows having multiple active tasks at the same time, and synchronizing people's interactions with background Python jobs.

class HelloWorldFlow(flow.Flow):
    start = (


urlpatterns = [
            HelloWorldFlow, icon=Icon('assignment')
    path('accounts/', AuthViewset().urls),
    path('', site.urls),


Class-based URL Configuration

A class with .urls property, suitable for inclusion into urlpatterns

Same concept as Django's class-based views but for URL routing configuration. Generalization of admin.urls and REST framework routers.

Class-based URL configuration allows you to quickly include existing applications into a website, configure, subclass, and redefine its functionality.

Viewflow contains several pre-built URL configurations for building a Site Menu structure, CRUD functionality, and quickly enables user interfaces for BPMN and FSM Workflows, along with many third-party apps.

from viewflow.contrib.auth import AuthViewset
from viewflow.urls import Application, Site, Viewset

class WebsiteViewset(Viewset):
    index_url = path('', index_view, name='index')

site = Site(title="ACME Corp", viewsets=[
        title='Sample App',

urlpatterns = [
    path('', site.urls),
    path('accounts/', AuthViewset(

See more at -

Finite State Machine

Finite state machine workflows are the declarative way to describe consecutive operations through a set of states and transitions between them.


viewflow.fsm.* can help you manage rules and restrictions around moving from one state to another. The package is suitable for getting low-level, database-independent FSM implementation or to wrap an existing database model and implement a simple, persistent workflow process with a quickly bootstrapped UI.

from enum import Enum
from viewflow.fsm import State

class Stage(Enum):
   NEW = 1
   DONE = 2
   HIDDEN = 3

class MyFlow(object):
    stage = State(Stage, default=Stage.NEW)

    @stage.transition(source=Stage.NEW, target=Stage.DONE)
    def complete(self):

    @stage.transition(source=State.ANY, target=Stage.HIDDEN)
    def hide(self):

flow = NyFlow()
flow.stage == Stage.NEW  # True
flow.stage = Stage.DONE  # Raises AttributeError

flow.stage == Stage.DONE  # True

flow.complete()  # Now raises TransitionNotAllowed

JSON Storage for Django Models

Maintain dumb business data and quick prototyping without DB migrations.

viewflow.jsonstore.* is the set of virtual Django Model fields that stores data inside a single JSON database column.

from viewflow import jsonstore
from django.db import models

class Employee(models.Model):
    data = JSONField(default={})
    full_name = jsonstore.CharField(max_length=250)
    hire_date = jsonstore.DateField()

The result model works like a usual Django model. All virtual fields are available to construct ModelForms, Viewsets, and Admin interfaces.

class EmployeeForm(forms.ModelForm):
    class Meta:
        model = Employee
        fields = ['full_name', 'hire_date', 'salary']

class EmployeeAdmin(admin.ModelAdmin):
    list_display = ['full_name', 'hire_date']
    fields = ['full_name', ('hire_date', 'salary')]

See more at:

Material UI Kit

Viewflow provides a theme kit based on Google Material Design components. Base page templates, Login, Logout, Password management views, Dashboard, Forms, and CRUD.

SPA look and feel with Turbolinks-enabled navigation and form processing.

All JavaScript is managed by Web Components based on Solid-JS library.

drawing drawing drawing



Viewflow is an Open Source project licensed under the terms of the AGPL license - The GNU Affero General Public License v3.0 <>_ with the Additional Permissions described in LICENSE_EXCEPTION <./LICENSE_EXCEPTION>_

You can read more about AGPL at AGPL FAQ <>_ This package license scheme follow GCC Runtime library licensing. If you use Linux already, this package license likely won't bring anything new to your stack.

Viewflow PRO has a commercial-friendly license allowing private forks and modifications of Viewflow. You can find the commercial license terms in COMM-LICENSE.

Latest Changelog


  • Work in progress

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-viewflow-2.0.0a2.tar.gz (3.4 MB view hashes)

Uploaded Source

Built Distribution

django_viewflow-2.0.0a2-py3-none-any.whl (3.4 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page