Skip to main content

Enterprise-grade, database-driven form builder with approval workflows and external data integration

Project description

Django Forms Workflows

Enterprise-grade, database-driven form builder with approval workflows and external data integration

License: LGPL v3 Python Version Django Version

Overview

Django Forms Workflows bridges the gap between simple form libraries (like Crispy Forms) and expensive SaaS solutions (like JotForm, Formstack). It provides:

  • ๐Ÿ“ Database-Driven Forms - Forms stored in database, not code
  • ๐Ÿ”„ Approval Workflows - Multi-step approval engine with notifications
  • ๐Ÿ”Œ External Data Integration - Pull data from LDAP, databases, APIs
  • ๐Ÿ”’ Enterprise Security - LDAP/AD authentication, complete audit trails
  • ๐Ÿ  Self-Hosted - No SaaS fees, full data control
  • ๐ŸŽจ Beautiful UI - Built on Crispy Forms and Bootstrap

Key Features

๐ŸŽฏ No-Code Form Creation

Business users can create and modify forms through Django Admin without touching code:

  • Drag-and-drop field ordering
  • 15+ field types (text, select, date, file upload, etc.)
  • Validation rules (required, regex, min/max, etc.)
  • Conditional field visibility
  • Custom help text and placeholders

๐Ÿ”„ Powerful Approval Workflows

Built-in multi-step approval engine:

  • Sequential or parallel approvals
  • Configurable approval logic (any/all approvers)
  • Email notifications and reminders
  • Complete audit trail
  • Approval delegation

๐Ÿ”Œ Configurable Prefill Sources

Automatically populate form fields from external systems with flexible, reusable configurations:

  • User Model - Current user's profile data (email, name, username)
  • LDAP/Active Directory - Enterprise directory attributes (department, title, manager)
  • External Databases - Pull from any SQL database with custom field mappings
  • REST APIs - Integrate with external services
  • System Values - Current date/time, previous submissions

New in v1.1: Prefill sources are now configurable database records with:

  • โœ… Dropdown Selection - Form builders select from pre-configured sources
  • โœ… Custom Field Mappings - Configure database lookup fields for different environments
  • โœ… Reusable Configurations - Define once, use across multiple forms
  • โœ… Centralized Management - All sources managed in Django Admin

Example database prefill configuration:

# Admin โ†’ Prefill Sources โ†’ Add Prefill Source
Name: Student - First Name
Source Type: Database
DB Schema: dbo
DB Table: STBIOS
DB Column: FIRST_NAME
DB Lookup Field: ID_NUMBER  # Column to match against
DB User Field: employee_id   # UserProfile field to use for lookup

See Prefill Sources Guide for detailed configuration.

๐Ÿ”„ Post-Submission Actions (NEW)

Automatically update external systems with form data after submission or approval:

  • Database Updates - Write data back to external databases with custom field mappings
  • LDAP Updates - Update Active Directory attributes
  • API Calls - Send data to external services via HTTP APIs
  • Custom Handlers - Execute custom Python code for complex integrations

Trigger Types:

  • โœ… On Submit - Execute immediately when form is submitted
  • โœ… On Approve - Execute when form is approved
  • โœ… On Reject - Execute when form is rejected
  • โœ… On Complete - Execute when workflow is complete

Features:

  • Conditional execution based on form field values
  • Automatic retries with configurable max attempts
  • Error handling (fail silently or block submission)
  • Execution ordering for dependent actions
  • Complete audit logging

Example database update configuration:

# Admin โ†’ Post-Submission Actions โ†’ Add
Name: Update HR Database
Action Type: Database Update
Trigger: On Approval
DB Field Mappings:
  [
    {"form_field": "email", "db_column": "EMAIL_ADDRESS"},
    {"form_field": "phone", "db_column": "PHONE_NUMBER"}
  ]

See Post-Submission Actions Guide for detailed configuration.

๐Ÿ”„ Cross-Instance Form Sync (Push / Pull)

Move form definitions between environments (test โ†’ staging โ†’ prod) entirely from the Django Admin โ€” no shell access or kubectl exec required:

  • Pull from Remote โ€” connect to any configured remote instance, preview available forms, and import selected ones with one click
  • Push to Remote โ€” select forms in the changelist and push them to any destination instance
  • Import / Export JSON โ€” download a portable .json snapshot or upload one from another instance
  • Conflict modes โ€” update (overwrite), skip (leave untouched), or new_slug (create a copy)
  • FORMS_SYNC_REMOTES setting โ€” pre-configure named instances (URL + token) so admins pick from a dropdown instead of typing credentials every time
  • HTTP endpoints (/forms-sync/export/ and /forms-sync/import/) protected by a shared Bearer token (FORMS_SYNC_API_TOKEN) for scripted / CI use

๐Ÿ”’ Enterprise-Ready Security

  • LDAP/Active Directory authentication
  • Role-based permissions
  • Complete audit logging (who, what, when, where)
  • CSRF protection
  • SQL injection prevention
  • File upload validation

๐Ÿ“Š Comprehensive Audit Trail

Track everything for compliance:

  • Form creation/modification
  • Form submissions
  • Approval decisions
  • Status changes
  • Field value changes
  • User actions with IP addresses

Quick Start

Installation

pip install django-forms-workflows

Basic Setup

  1. Add to INSTALLED_APPS:
INSTALLED_APPS = [
    # ...
    'crispy_forms',
    'crispy_bootstrap5',
    'django_forms_workflows',
    # ...
]
  1. Configure settings:
# Crispy Forms
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
CRISPY_TEMPLATE_PACK = "bootstrap5"

# Forms Workflows
FORMS_WORKFLOWS = {
    'ENABLE_APPROVALS': True,
    'ENABLE_AUDIT_LOG': True,
    'ENABLE_FILE_UPLOADS': True,
    'MAX_FILE_SIZE': 10 * 1024 * 1024,  # 10MB
}
  1. Run migrations:
python manage.py migrate django_forms_workflows
  1. Include URLs:
urlpatterns = [
    path('forms/', include('django_forms_workflows.urls')),
]
  1. Create your first form in Django Admin!

Architecture

graph TB
    subgraph UI["User Interface"]
        FB["Form Builder<br/>(Admin)"]
        FV["Form Viewer<br/>(End User)"]
        AU["Approval UI<br/>(Approvers)"]
    end

    subgraph Django["Django Application"]
        subgraph DSL["Data Source Abstraction Layer"]
            LDAP["LDAP<br/>Source"]
            DB["Database<br/>Source"]
            API["API<br/>Source"]
        end
    end

    subgraph External["External Systems"]
        AD["Active<br/>Directory"]
        Legacy["Legacy<br/>Databases"]
        ExtAPI["External<br/>APIs"]
    end

    UI --> Django
    DSL --> External

    style UI fill:#e1f5ff
    style Django fill:#fff4e1
    style DSL fill:#ffe1f5
    style External fill:#e1ffe1

Use Cases

Perfect for:

  • HR Departments - Employee onboarding, time-off requests, expense reports
  • IT Departments - Access requests, equipment requests, change management
  • Finance - Purchase orders, invoice approvals, budget requests
  • Education - Student applications, course registrations, facility requests
  • Healthcare - Patient intake, referrals, insurance claims
  • Government - Permit applications, FOIA requests, citizen services

Documentation

Comparison

Feature Django Forms Workflows Crispy Forms FormStack Django-Formtools
Database-driven forms โœ… โŒ โœ… โŒ
No-code form creation โœ… โŒ โœ… โŒ
Self-hosted โœ… โœ… โŒ โœ…
Approval workflows โœ… โŒ โš ๏ธ โŒ
External data prefill โœ… โŒ โš ๏ธ โŒ
LDAP/AD integration โœ… โŒ โŒ โŒ
Audit trail โœ… โŒ โœ… โŒ
Open source โœ… โœ… โŒ โœ…

Requirements

  • Python 3.10+
  • Django 5.1+
  • PostgreSQL 12+ (recommended) or MySQL 8.0+
  • Celery 5.0+ (for background tasks)
  • Redis/Valkey (for Celery broker)

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

License

GNU Lesser General Public License v3.0 (LGPLv3) - see LICENSE for details.

Support

Roadmap

Phase 1: Core (Current)

  • Database-driven form definitions
  • Dynamic form rendering
  • Approval workflows
  • LDAP integration
  • Database prefill
  • Audit logging

Phase 2: Enhanced UX

  • Form builder UI (drag-and-drop)
  • Conditional field visibility (client-side)
  • File upload validation
  • Form templates/cloning
  • Dashboard analytics

Phase 3: Advanced Features

  • Cross-instance form sync (push/pull) via Admin UI and HTTP API
  • REST API for form submission
  • Webhook support
  • Custom field types (signature, location, etc.)
  • Advanced reporting
  • Form versioning

Phase 4: Enterprise

  • Multi-tenancy support
  • SSO integration (SAML, OAuth)
  • Advanced RBAC
  • White-label support
  • Plugin marketplace

Credits

Built with โค๏ธ by the Django community.

Special thanks to:

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

django_forms_workflows-0.14.16.tar.gz (223.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_forms_workflows-0.14.16-py3-none-any.whl (272.8 kB view details)

Uploaded Python 3

File details

Details for the file django_forms_workflows-0.14.16.tar.gz.

File metadata

  • Download URL: django_forms_workflows-0.14.16.tar.gz
  • Upload date:
  • Size: 223.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for django_forms_workflows-0.14.16.tar.gz
Algorithm Hash digest
SHA256 04c04e4d068717dabcc90d2272b5f9ea33c27208c47e8ca1b4a51176819274ae
MD5 88cafb68f243afe2ff440bd1e991aea6
BLAKE2b-256 becdcdb93f7e7b2eeb4bcdaec4d4cbfa20e0b95a8c2832f02e02c9656ee415a4

See more details on using hashes here.

File details

Details for the file django_forms_workflows-0.14.16-py3-none-any.whl.

File metadata

File hashes

Hashes for django_forms_workflows-0.14.16-py3-none-any.whl
Algorithm Hash digest
SHA256 96e69057d3eced54778b21b053d1a32296437c17e1ebeecc93ad3e3686cb973f
MD5 c8213ecd3256bb88295614135fbd3db2
BLAKE2b-256 960606085efadd25da899c321a3e9d4a73be3a6f3a65b7c2d3506edcd428f8cb

See more details on using hashes here.

Supported by

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