Skip to main content

Modern Django framework with type-safe Pydantic v2 configuration, Next.js admin integration, real-time WebSockets, and 8 enterprise apps. Replace settings.py with validated models, 90% less code. Production-ready with AI agents, auto-generated TypeScript clients, and zero-config features.

Project description

Django-CFG

Django-CFG

PyPI Python Django License Downloads

The Modern Django Framework for Enterprise Applications

Type-safe configuration • Real-time WebSockets • gRPC Streaming • OpenAPI client generation • AI-Native Docs • 8 Production Apps

Get StartedLive DemoDocumentationMCP Server


What is Django-CFG?

Django-CFG is a next-generation Django framework that replaces settings.py with type-safe Pydantic v2 models. Catch configuration errors at startup, get full IDE autocomplete, and ship production-ready features in 30 seconds instead of weeks.

Why Django-CFG?

  • Type-safe config - Pydantic v2 validation catches errors before deployment
  • 90% less code - Replace 200+ line settings.py with 30 lines
  • Typed API clients - Generate TypeScript / Python / Go clients from your DRF OpenAPI schema
  • Real-time WebSockets - Centrifugo integration included
  • gRPC streaming - Bidirectional streaming with WebSocket bridge
  • AI-native docs - First Django framework with MCP server for AI assistants
  • Stripe payments - Checkout, webhooks, refunds out of the box (django-cfg[payments])
  • 8 enterprise apps - Save 18+ months of development

Quick Start

One-Line Install

# macOS / Linux
curl -L https://djangocfg.com/install.sh | sh

# Windows (PowerShell)
powershell -c "iwr https://djangocfg.com/install.ps1 | iex"

Manual Install

pip install 'django-cfg[full]'
django-cfg create-project my_app
cd my_app/projects/django
poetry run python manage.py runserver

What you get instantly:

  • 🎨 Django Admin (Unfold) → http://127.0.0.1:8000/admin/
  • 📡 Real-time WebSockets → Live updates
  • 🔌 Auto-generated API clients → TypeScript / Python / Go
  • 🐳 Docker Ready → Production configs
  • 🖥️ Electron App → Desktop template

→ Full Installation Guide


Configuration Example

Before: settings.py

# 200+ lines of untyped configuration
DEBUG = os.getenv('DEBUG', 'False') == 'True'  # ❌ Bug waiting to happen
DATABASE_PORT = os.getenv('DB_PORT', '5432')   # ❌ Still a string!

After: Django-CFG

from django_cfg import DjangoConfig, DatabaseConfig

class MyConfig(DjangoConfig):
    project_name: str = "My App"
    debug: bool = False  # ✅ Type-safe

    databases: dict[str, DatabaseConfig] = {
        "default": DatabaseConfig(
            name="${DB_NAME}",  # ✅ Validated at startup
            port=5432,          # ✅ Correct type
        )
    }

Full IDE autocompleteStartup validationZero runtime errors


Features

🔒 Type-Safe Configuration

Pydantic v2 models replace error-prone settings.py - catch bugs before deployment.

🔌 Typed API Client Generation

Generate fully-typed TypeScript, Python, and Go clients straight from your DRF OpenAPI schema — no hand-written API code, no drift between backend and frontend.

python manage.py gen          # generate clients from the live OpenAPI schema
python manage.py gen --ts     # TypeScript only

📡 Real-Time WebSockets

Production-ready Centrifugo integration - live updates, notifications, presence tracking.

🌐 gRPC Microservices

Bidirectional streaming with automatic WebSocket bridge - perfect for real-time architectures.

💳 Payments Engine

Stripe-first payments app, production-lifted from a live SaaS: one-time checkout with idempotency, signature-verified webhooks with replay, refunds, reconciliation, and an in-memory fake provider for tests. Host couplings are config seams (owner model, fulfillment hook) — plug in your own billing objects.

from django_cfg import DjangoConfig, PaymentsConfig

class MyConfig(DjangoConfig):
    payments = PaymentsConfig(
        fulfillment_hook="apps.orders.hooks.activate_order",
    )
pip install 'django-cfg[payments]'   # adds the Stripe SDK

🤖 AI-Native Documentation

First Django framework with MCP server - AI assistants can access docs instantly.

📦 8 Enterprise Apps

User auth • Support tickets • Newsletter • CRM • AI agents • Knowledge base • Payments • Multi-site

Time saved: 18+ months of development

→ See All Features


What's Included

Backend:

  • Django 5.2+ with type-safe config
  • PostgreSQL, Redis, Centrifugo
  • gRPC server with streaming
  • 8 production-ready apps
  • Stripe payments engine (checkout, webhooks, refunds)
  • AI agent framework
  • REST API with auto TypeScript generation

Admin:

  • Django Unfold for CRUD
  • JWT authentication
  • Dark theme by default
  • Constance-backed dynamic settings

DevOps:

  • Docker Compose setup
  • Traefik reverse proxy
  • Production-ready configs
  • Cloudflare integration

AI Features:

  • MCP server for AI assistants
  • Pydantic AI integration
  • Vector DB (ChromaDB)
  • RAG support

Documentation


Community


License

MIT License - Free for commercial use


Django-CFG - Modern Django framework with type-safe configuration, AI-native docs, typed API client generation, gRPC streaming, real-time WebSockets, and 8 production-ready apps.

Made with ❤️ for the Django community

Get StartedLive DemoGitHub

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_cfg-2.2.108.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

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

django_cfg-2.2.108-py3-none-any.whl (2.2 MB view details)

Uploaded Python 3

File details

Details for the file django_cfg-2.2.108.tar.gz.

File metadata

  • Download URL: django_cfg-2.2.108.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for django_cfg-2.2.108.tar.gz
Algorithm Hash digest
SHA256 35cf36c8f4a5c8081d9a25551a704a8394ccfe6e08840852d28a7c30658eb863
MD5 b0e79f6575334d557974d7eb3e311e60
BLAKE2b-256 8ce8936ea1c371f32a636a0633cf20cac1035e801793a8452ab1f4c8f0e57616

See more details on using hashes here.

File details

Details for the file django_cfg-2.2.108-py3-none-any.whl.

File metadata

  • Download URL: django_cfg-2.2.108-py3-none-any.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for django_cfg-2.2.108-py3-none-any.whl
Algorithm Hash digest
SHA256 ad4af5fe76d4efce9d22c2957d0c35bcb41bff35d5a14d73a18c97a50625ac75
MD5 cdf2843a4a3524cb3d9e4eb85d28a971
BLAKE2b-256 ed29fa286148fc5ce1c25948683c15ff3db0a13f66e93c3590d5e6a0864436f4

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