Django CFG gives you a working starting point for a SaaS product: a Django API,
a Next.js app and account cabinet, Storybook for the shared UI, and the services
that run them. The Docker workspace runs on a Linux development server; your
editor, browser and AI agent can stay on your computer.
Start here
Run the whole workspace. Clone the
public repository, check the
Docker prerequisites,
then run make docker-quickstart from the repository root on your Docker host.
Use Django CFG in your own project. Run .
The library works without Docker, the reference app or CMDOP.
python -m pip install django-cfg
Three things you get
A container your AI can work in. Quickstart starts the CMDOP workspace
alongside the app. Once you admit the machine and grant access, your AI agent
can connect over MCP or the SDK to work in that checkout. Just starting Docker
does not enroll the machine or grant access.
A lean Django app. Django CFG is a reusable Python library for validated
settings, common application modules and DRF/OpenAPI client generation.
Your code stays focused on the product instead of rebuilding the same Django
setup every time.
A development loop that runs on your server. Open the running app and
Storybook from your computer, refine UI components independently, and work on
Django and the API in parallel. Verify the pieces together in the reference
app before deploying through your production workflow.
Talk to your agent. Build your app.
Describe a change out loud in a voice-capable AI client instead of typing out
the implementation. Once you've admitted your Docker CFG workspace to CMDOP
and granted that client the access it needs, the agent can edit the checkout
and run its tests on the development host. Review the change in the app or in
Storybook from your laptop before it ships.
For example, in a CarAPIS development workspace you might say: “Show the
listing source on the car card, add a Storybook story, and run the tests.”
This is an example workflow. Voice comes from your AI client; CMDOP connects
it to the workspace you approved.
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
Modules worth knowing about
These are Django CFG capabilities you can use in your own project, whether or
not you run the Docker workspace.
Expose permissioned tools for your Django application. This is separate from CMDOP access to its Docker workspace.
Some modules need an extra, Redis or provider credentials. The
full module catalog
shows what each one needs.
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.
Included by default
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
Analytics
django_cfg.apps.tools.analytics
First-party pageviews, sessions and attribution; can be reconfigured or disabled
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
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.
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 Git checkout of the complete Docker CFG development workspace (Git required):
django-cfg create-project myproject
cd myproject
On a supported Linux Docker host, run make docker-quickstart from the checkout root.
For a project that only uses the Python library, follow the
installation guide.
The old shell and PowerShell bootstrap installers are retired. Existing projects
keep their source and data; update their own dependency lock.
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.
Develop on a server, see it on your computer
Run the workspace on the Docker host. From your computer, in a clone of this
repository, run make docker-forward CFG_SSH_HOST=your-server using your SSH
host alias and your chosen base port if you changed it. With the defaults, open
http://localhost:28080 for the app and http://localhost:28082 for Storybook.
The same tunnel carries Docs and the API, including WebSockets. No server IP
goes into the app's browser URLs.
To let an AI agent work in that checkout, follow the
CMDOP owner admission steps.
Agent access and the browser tunnel are separate. The workspace is for
development; production deployment still needs your normal release workflow
and production configuration.
The public repository contains the generated Python package and
canonical solution source. The editable Nextra documentation lives once in
the frontend workspace at
docker-cfg/frontend/apps/docs/content/; there is no second
root docs/ handbook.
MIT. See LICENSE. Django CFG is part of the CMDOP ecosystem;
Django and other third-party projects retain their own names and licenses.
Develop from this checkout
The public repository uses a flat package layout: django_cfg/ contains the
Python package, and the generated root pyproject.toml describes that layout.
Use Python 3.12 or newer and run installation from the repository root:
This installs the declared dependencies and connects imports to this checkout,
so package source edits are visible without reinstalling. Use a separate virtual
environment per consumer. Pin a Git commit when reproducible source is required.
When present, django_cfg/pyproject.toml is metadata bundled in the published
wheel; it is not the installation root. Production consumers can continue to install
the versioned django-cfg release from PyPI.