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.

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.

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

Modules worth knowing about

These are Django CFG capabilities you can use in your own project, whether or not you run the Docker workspace.

Module What you can build with it
Django Admin and Dashboard Describe admin lists, filters and actions in typed Python. Add your own dashboard tabs with Django views and templates.
Realtime Publish typed events from Django to authenticated browsers over WebSockets, with per-topic permissions and replay after reconnect.
Frontend Errors and Logging See recurring browser errors by signature in Admin and emit structured server logs to your own logging platform.
FastAPI ORM Generator Turn Django models into SQLModel tables, Pydantic schemas and async CRUD repositories for a FastAPI service.
LLM Services Add text, vision and OCR or image generation through a configured provider, with caching and cost tracking.
Telegram Send notifications or media through your bot, with rate limiting and duplicate suppression.
App MCP 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.

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

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

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

Built distribution (wheel)

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

Total release size: 5.7 MB

Release files / django_cfg-2.4.129.tar.gz

Download URL django_cfg-2.4.129.tar.gz
Size 2.5 MB
Tags Source
SHA-256 checksum
How to use checksums
e6561e328fd95863ccc030f474b686b4f8803522ed04e22249ca395aadf21a80
BLAKE2b-256 checksum
How to use checksums
5ce513b6424fdd315d02a1a2482521565896b5d229dffab90eaaf2769f6da87f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.2

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

Download URL django_cfg-2.4.129-py3-none-any.whl
Size 3.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
12b35a8422c8a1c69f7d98f55e3df85a3b241475059432018a929cc21b197903
BLAKE2b-256 checksum
How to use checksums
74365a34f89d2926f28452b6909f127a888f610cbdff9408b8b63c7852820a2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.2

Security for django-cfg 2.4.129

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