Skip to main content

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

Django CFG

PyPI Python Django License

Launch a complete SaaS development stack in one command.

Django, Next.js, Storybook and a CMDOP workspace, ready to build on.

Documentation · Installation · Built-in apps · GitHub Issues


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 python -m pip install django-cfg. The library works without Docker, the reference app or CMDOP.

Three things you get

  1. 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.
  2. 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.
  3. 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.

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.

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.

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 docker-cfg/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.

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:

python3 -m venv .venv
.venv/bin/python -m pip install -e .

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.

Metadata

Release files for django-cfg 2.4.124

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

Built distribution (wheel)

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

Total release size: 5.7 MB

Release files / django_cfg-2.4.124.tar.gz

Download URL django_cfg-2.4.124.tar.gz
Size 2.5 MB
Tags Source
SHA-256 checksum
How to use checksums
425a9749d5e900c6154ec463bd27d7b10b90d3853ef98dac7c8fdabe04a0f466
BLAKE2b-256 checksum
How to use checksums
d173cfa1ca4d95d511b279f458d1cc667e00926e8a1fb780f69e31b5905c9ecb
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.124-py3-none-any.whl

Download URL django_cfg-2.4.124-py3-none-any.whl
Size 3.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ad1494be565d4787da45d8a4da1c2f68e52b2e4e613c8cebea030dfa0c53b476
BLAKE2b-256 checksum
How to use checksums
4a5a399cc459f4e73c26f54edbd3782cb183462cf9eaa987b3cbca7624cb8ca3
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.124

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.124 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