Django CFG
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.123
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_cfg-2.4.123.tar.gz | 2.5 MB | Without provenance | Details for django_cfg-2.4.123.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_cfg-2.4.123-py3-none-any.whl | Python 3 | none | any | Details for django_cfg-2.4.123-py3-none-any.whl |
Total release size: 5.7 MB
Release files / django_cfg-2.4.123.tar.gz
| Download URL | django_cfg-2.4.123.tar.gz |
|---|---|
| Size | 2.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9845383943c30a6a2e7f2596ad391eaafc1674e02539ef7ed138b8d6d9037ddf
|
|
BLAKE2b-256 checksum How to use checksums |
0cf9465d98b36976ffbc8b091be5f66a216513219dd903ce727df82d45d18a33
|
| 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.123-py3-none-any.whl
| Download URL | django_cfg-2.4.123-py3-none-any.whl |
|---|---|
| Size | 3.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2f039a7acaaba44b28e22afe99a834f5420fdee5d09f428b6252e407fbb7402f
|
|
BLAKE2b-256 checksum How to use checksums |
8a4a9217c02005ce648a3f5b4fc98372ed281b6343a05248b385d57c9913e010
|
| 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.123
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.