Skip to main content

Django CFG by CMDOP: Django, Frontend and Storybook in a Docker CFG workspace

Django CFG

PyPI Python Django License

Stop wiring Django by hand. Start with the application platform already connected.

One validated configuration. Built-in Django applications. Generated API clients. A frontend workspace. Optional Docker development with CMDOP.

Documentation · Installation · Built-in apps · GitHub Issues


Django CFG is an open-source framework for building production-minded Django applications. It replaces scattered settings and manual glue with Pydantic v2 configuration, a modular application layer, DRF/OpenAPI tooling and a maintained frontend workspace.

The Python package works on its own. The larger repository adds the frontend, documentation, Storybook and a separate Docker CFG development environment. CMDOP connectivity is optional and always separately authorized.

What comes together

View the Django CFG platform diagram.

Layer What it provides
Configuration Typed Pydantic models, validation at startup, environment-aware settings and explicit feature switches
Django applications Accounts, TOTP, mail, analytics, health, management-command API and opt-in business capabilities
API contracts Django REST Framework, OpenAPI schemas and generated clients for TypeScript, Python, Go, Rust, Swift and Protocol Buffers
Frontend workspace Next.js applications, shared packages, UI components, data clients, widgets and Storybook
Developer workflow CLI project creation, code generation, tests, documentation and a Git-root development workflow
Optional environment Docker CFG combines the reference application, frontend, Storybook and PostgreSQL; an independently admitted CMDOP workspace enables remote machine work

Built-in Django applications

Django CFG registers its own apps in INSTALLED_APPS. Core apps are wired automatically; feature apps are enabled through typed configuration. You do not manually copy their app paths into project_apps.

Always available

Application Django app Purpose
Accounts django_cfg.apps.system.accounts OTP sign-in, JWT, OAuth, API keys, profiles, login alerts and abuse protection
TOTP django_cfg.apps.system.totp Two-factor authentication and recovery codes
Mailer django_cfg.apps.system.mailer Localized email content, delivery workflow and send log
Health API django_cfg.apps.api.health Application health endpoints
Commands API django_cfg.apps.api.commands Authenticated management-command API

Core framework modules also provide Tailwind integration, LLM services, OpenAPI client generation, sitemap feeds and monitoring.

Enable with configuration

Config field Application What it adds
currency django_cfg.apps.tools.currency Currency rates and conversion
geo django_cfg.apps.tools.geo Countries, regions and cities
analytics django_cfg.apps.tools.analytics First-party pageviews, sessions and attribution; enabled by default
chat django_cfg.apps.tools.chat Ready-to-use conversation and message models/API
payments django_cfg.apps.payments Checkout, webhooks, refunds and Stripe-first provider integration
simple_history simple_history Model change history
django_rq django_cfg.modules.django_rq + django_rq Background jobs and scheduled tasks
mcp django_cfg.modules.django_mcp Permissioned application tools for MCP clients
notion django_cfg.modules.django_notion Notion lead/data delivery

Each feature remains independently configurable. Optional integrations may require a matching extra or external service; enabling an app does not silently provision those services.

See the complete built-in app reference and module documentation.

Configuration stays readable

A project is a typed configuration object, not a pile of loosely related environment variables.

import os

from django_cfg import (
    AnalyticsConfig,
    CurrencyConfig,
    DjangoConfig,
    GeoConfig,
    PaymentsConfig,
)


class ProjectConfig(DjangoConfig):
    project_name: str = "Acme"
    secret_key: str = os.environ["DJANGO_SECRET_KEY"]

    # Analytics is enabled by default. Configure it explicitly when desired.
    analytics: AnalyticsConfig = AnalyticsConfig()

    # Each block enables and configures its corresponding built-in app.
    currency: CurrencyConfig = CurrencyConfig(target_currency="USD")
    geo: GeoConfig = GeoConfig(countries=["ID", "SG"])
    payments: PaymentsConfig = PaymentsConfig()

Store a long, unique DJANGO_SECRET_KEY in your secret manager or environment. Do not commit it. Payments uses the optional Stripe dependency:

python -m pip install "django-cfg[payments]"

For the full set of configuration fields, defaults and environment variables, use the configuration reference.

Install the framework

Requires Python 3.12 or 3.13 and supports Django 5.2.14+, 6.0 and 6.1 within the package's declared dependency range.

python -m pip install django-cfg
django-cfg info

Create a standalone project:

django-cfg create-project myproject
cd myproject

Then follow the installation guide to configure the database, environment and development server.

Generate API clients from your Django API

Django CFG connects DRF endpoints to a shared OpenAPI contract and a multi-language generation pipeline.

Target Typical use
TypeScript web React/Next.js clients, hooks, schemas and mocks
TypeScript CLI Standalone Fetch clients without frontend runtime
Python Typed API consumers and service integrations
Go Typed API clients for Go applications
Rust Generated Cargo client crates
Swift / Swift Codable Native Apple clients
Protocol Buffers Schema and service interoperability

Language-specific generators may require external toolchains. The API generation guide documents target configuration, generated output and the supported workflow.

The complete development environment

The Python package is only one layer. The canonical repository also contains the Django reference application and a complete Next.js frontend workspace.

For teams that want an integrated server-side development environment, the separate Docker CFG project brings together:

  • the Django CFG reference backend;
  • a Next.js site and account cabinet;
  • Storybook for the shared UI;
  • PostgreSQL and the supporting development services;
  • an independently enrolled CMDOP workspace for agent-assisted work on your own Git repository through MCP or the SDK.

CMDOP access is not implied by installing Django CFG. A workspace is admitted by its owner, and each client receives its own approved permissions. This is a development workflow, not a turnkey production deployment. Docker CFG remains a separate companion project, not a dependency of pip install.

Read the Docker development quick start, CMDOP integration guide and CMDOP documentation.

Explore the documentation

Start here What you'll find
Installation Create a project and configure its environment
Configuration Typed settings, database, cache, storage and security
Built-in applications App inventory and feature switches
API generation OpenAPI and multi-language clients
Modules Optional framework modules and integrations
Development environment Docker CFG workflow and local services

Repository

The public repository contains the generated Python package, installers and canonical solution source. The editable Nextra documentation lives once in the frontend workspace at solution/projects/frontend/apps/docs/content/; there is no second root docs/ handbook.

License

MIT. See LICENSE. Django CFG is part of the CMDOP ecosystem; Django and other third-party projects retain their own names and licenses.

Metadata

Release files for django-cfg 2.4.122

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-cfg 2.4.122
File Size Uploaded Provenance Actions
django_cfg-2.4.122.tar.gz 2.5 MB Without provenance Details for django_cfg-2.4.122.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-cfg 2.4.122
File Interpreter ABI Platform Actions
django_cfg-2.4.122-py3-none-any.whl Python 3 none any Details for django_cfg-2.4.122-py3-none-any.whl

Total release size: 5.7 MB

Release files / django_cfg-2.4.122.tar.gz

Download URL django_cfg-2.4.122.tar.gz
Size 2.5 MB
Tags Source
SHA-256 checksum
How to use checksums
3a5c878b2d73b613e91727ebfe8d08f1d7b0a0fe6d1ee5811e1fec443228e0a4
BLAKE2b-256 checksum
How to use checksums
f2697fa9a43539da32bbb37bb96dff3b75defcd244f3c51adf7c620e16374101
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release files / django_cfg-2.4.122-py3-none-any.whl

Download URL django_cfg-2.4.122-py3-none-any.whl
Size 3.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
602ee0d6f93718085187a511e11bb3f6edd44ca8e55a1e3256830ec78be78c26
BLAKE2b-256 checksum
How to use checksums
d73a04ce1476b6a718f6198601ac21e27014b986ca02f723b9d71602a06abb19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Security for django-cfg 2.4.122

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.4.122 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