Metadata-Version: 2.4
Name: django-cfg
Version: 2.4.123
Summary: Django CFG by CMDOP: typed Pydantic configuration, modular Django apps, generated API clients and a complete frontend development workspace.
Project-URL: Homepage, https://djangocfg.cmdop.ai
Project-URL: Documentation, https://djangocfg.cmdop.ai
Project-URL: Repository, https://github.com/commandoperator/cmdop-djangocfg
Project-URL: Issues, https://github.com/commandoperator/cmdop-djangocfg/issues
Project-URL: Changelog, https://github.com/commandoperator/cmdop-djangocfg/blob/main/CHANGELOG.md
Author-email: Django-CFG Team <info@djangocfg.com>
Maintainer-email: Django-CFG Team <info@djangocfg.com>
License: MIT
License-File: LICENSE
Keywords: ai-agents,configuration,django,django-environ,django-settings,enterprise-django,ide-autocomplete,modern-django,nextjs-admin,pydantic,pydantic-settings,react-admin,settings,startup-validation,type-safe-config,type-safety,typescript-generation
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Framework :: Django :: 6.1
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Systems Administration
Classifier: Typing :: Typed
Requires-Python: <3.14,>=3.12
Requires-Dist: adrf<0.2.0,>=0.1.11
Requires-Dist: aiohttp<4.0,>=3.13.4
Requires-Dist: aiometer<2.0,>=1.0.0
Requires-Dist: beautifulsoup4<5.0,>=4.13.0
Requires-Dist: c2pa-python!=0.38.2,>=0.38.0
Requires-Dist: cachetools<7.0,>=5.3.0
Requires-Dist: click<9.0,>=8.2.0
Requires-Dist: coolname<3.0,>=2.2.0
Requires-Dist: cryptography>=46.0.7
Requires-Dist: django-admin-rangefilter<1.0,>=0.13.0
Requires-Dist: django-axes[ipware]<10.0.0,>=8.0.0
Requires-Dist: django-constance<5.0,>=4.3.0
Requires-Dist: django-cors-headers<5.0,>=4.7.0
Requires-Dist: django-extensions<5.0,>=4.1.0
Requires-Dist: django-filter<27.0,>=25.0
Requires-Dist: django-import-export<5.0,>=4.3.0
Requires-Dist: django-json-widget<3.0,>=2.0.0
Requires-Dist: django-ratelimit<5.0.0,>=4.1.0
Requires-Dist: django-redis<8.0,>=6.0.0
Requires-Dist: django-simple-history<4.0,>=3.7.0
Requires-Dist: django-tailwind[reload]<5.0.0,>=4.2.0
Requires-Dist: django<6.2,>=5.2.14
Requires-Dist: djangorestframework-simplejwt<6.0,>=5.5.1
Requires-Dist: djangorestframework<4.0,>=3.16.0
Requires-Dist: drf-nested-routers<1.0,>=0.95.0
Requires-Dist: drf-spectacular-sidecar<2026.0,>=2025.8.0
Requires-Dist: drf-spectacular<1.0,>=0.28.0
Requires-Dist: email-validator<3.0,>=2.3.0
Requires-Dist: geopy<3.0,>=2.4.0
Requires-Dist: hiredis<4.0,>=2.0.0
Requires-Dist: httpx<1.0,>=0.28.1
Requires-Dist: jinja2<4.0.0,>=3.1.6
Requires-Dist: json-repair<1.0,>=0.30
Requires-Dist: lxml<7.0,>=6.1.0
Requires-Dist: mistune<4.0,>=3.2.1
Requires-Dist: notion-client<4.0,>=3.1.0
Requires-Dist: openai<3.0,>=2.45.0
Requires-Dist: opencv-python-headless>=5.0.0.93
Requires-Dist: pgvector<1.0,>=0.4.2
Requires-Dist: pillow<13.0,>=12.2.0
Requires-Dist: platformdirs<5.0,>=4.0
Requires-Dist: psutil>=7.0.0
Requires-Dist: psycopg[binary,pool]<4.0,>=3.2.0
Requires-Dist: pydantic-settings<3.0.0,>=2.11.0
Requires-Dist: pydantic-yaml<2.0,>=1.6.0
Requires-Dist: pydantic<3.0,>=2.11.0
Requires-Dist: pydantic[email]<3.0,>=2.11.0
Requires-Dist: pygments<3.0,>=2.20.0
Requires-Dist: pyotp<3.0,>=2.9.0
Requires-Dist: pytelegrambotapi<5.0,>=4.28.0
Requires-Dist: pyyaml<7.0,>=6.0
Requires-Dist: qrcode<9.0,>=8.2
Requires-Dist: questionary<3.0,>=2.1.0
Requires-Dist: redis<7.0,>=6.4.0
Requires-Dist: remove-ai-watermarks<1.0,>=0.58.1
Requires-Dist: requests<3.0,>=2.33.0
Requires-Dist: rich<15.0,>=14.0.0
Requires-Dist: setuptools>=75.0.0; python_version >= '3.13'
Requires-Dist: tenacity<10.0.0,>=9.1.2
Requires-Dist: tiktoken<1.0,>=0.12.0
Requires-Dist: tzlocal<6.0,>=5.3.1
Requires-Dist: ua-parser[regex]<2.0,>=1.0.0
Requires-Dist: whitenoise<7.0,>=6.8.0
Provides-Extra: ai
Requires-Dist: pydantic-ai-harness[code-mode]<0.7,>=0.6.0; extra == 'ai'
Requires-Dist: pydantic-ai-slim[openai]<3.0,>=2.10.0; extra == 'ai'
Requires-Dist: pydantic-monty<0.0.19,>=0.0.16; extra == 'ai'
Requires-Dist: toon-format<2.0,>=1.0.0; extra == 'ai'
Provides-Extra: dev
Requires-Dist: betterproto2-compiler<1.0,>=0.9.0; extra == 'dev'
Requires-Dist: black>=23.0; extra == 'dev'
Requires-Dist: build>=1.0; extra == 'dev'
Requires-Dist: django-stubs[compatible-mypy]<7.0,>=5.2.9; extra == 'dev'
Requires-Dist: django<6.2,>=5.2.14; extra == 'dev'
Requires-Dist: djangorestframework-stubs[compatible-mypy]<4.0,>=3.16.8; extra == 'dev'
Requires-Dist: factory-boy>=3.0; extra == 'dev'
Requires-Dist: fakeredis>=2.0; extra == 'dev'
Requires-Dist: flake8>=5.0; extra == 'dev'
Requires-Dist: isort>=5.0; extra == 'dev'
Requires-Dist: mkdocs-material>=9.0; extra == 'dev'
Requires-Dist: mkdocs>=1.5; extra == 'dev'
Requires-Dist: mkdocstrings[python]>=0.24; extra == 'dev'
Requires-Dist: mypy<2.0.0,>=1.18.2; extra == 'dev'
Requires-Dist: pre-commit>=3.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest-django>=4.5; extra == 'dev'
Requires-Dist: pytest-mock>=3.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: questionary>=2.0; extra == 'dev'
Requires-Dist: redis>=5.0; extra == 'dev'
Requires-Dist: rich>=13.0; extra == 'dev'
Requires-Dist: tomlkit>=0.11; extra == 'dev'
Requires-Dist: twine>=4.0; extra == 'dev'
Provides-Extra: django52
Requires-Dist: django<6.2,>=5.2.14; extra == 'django52'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.0; extra == 'docs'
Requires-Dist: mkdocs>=1.5; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.24; extra == 'docs'
Requires-Dist: pymdown-extensions>=10.0; extra == 'docs'
Provides-Extra: full
Requires-Dist: alembic<2.0,>=1.13; extra == 'full'
Requires-Dist: asyncpg<1.0,>=0.29; extra == 'full'
Requires-Dist: boto3<2.0,>=1.34; extra == 'full'
Requires-Dist: django-rq>=4.2.0; extra == 'full'
Requires-Dist: django-storages<2.0,>=1.14; extra == 'full'
Requires-Dist: django<6.2,>=5.2.14; extra == 'full'
Requires-Dist: hiredis>=2.0; extra == 'full'
Requires-Dist: openapi-python-client<1,>=0.21; extra == 'full'
Requires-Dist: pydantic-ai-harness[code-mode]<0.7,>=0.6.0; extra == 'full'
Requires-Dist: pydantic-ai-slim[openai]<3.0,>=2.10.0; extra == 'full'
Requires-Dist: pydantic-monty<0.0.19,>=0.0.16; extra == 'full'
Requires-Dist: pytest-django>=4.5; extra == 'full'
Requires-Dist: pytest-mock>=3.0; extra == 'full'
Requires-Dist: pytest>=7.0; extra == 'full'
Requires-Dist: questionary>=2.0; extra == 'full'
Requires-Dist: redis>=5.0; extra == 'full'
Requires-Dist: rich>=13.0; extra == 'full'
Requires-Dist: rq<4.0,>=3.0.0; extra == 'full'
Requires-Dist: sqlalchemy<3.0,>=2.0; extra == 'full'
Requires-Dist: sqlmodel<1.0,>=0.0.16; extra == 'full'
Requires-Dist: stripe<16.0,>=15.3.0; extra == 'full'
Requires-Dist: toon-format<2.0,>=1.0.0; extra == 'full'
Requires-Dist: uvicorn<1.0,>=0.53; extra == 'full'
Requires-Dist: websockets<17,>=13; extra == 'full'
Provides-Extra: gen
Requires-Dist: alembic<2.0,>=1.13; extra == 'gen'
Requires-Dist: asyncpg<1.0,>=0.29; extra == 'gen'
Requires-Dist: grpcio-tools<2.0,>=1.50.0; extra == 'gen'
Requires-Dist: openapi-python-client<1,>=0.21; extra == 'gen'
Requires-Dist: protobuf<7.0,>=5.0; extra == 'gen'
Requires-Dist: sqlalchemy<3.0,>=2.0; extra == 'gen'
Requires-Dist: sqlmodel<1.0,>=0.0.16; extra == 'gen'
Provides-Extra: geoip
Requires-Dist: geoip2<6.0,>=5.0; extra == 'geoip'
Provides-Extra: local
Provides-Extra: mcp-sql
Requires-Dist: pglast<9.0,>=7.0; extra == 'mcp-sql'
Provides-Extra: payments
Requires-Dist: stripe<16.0,>=15.3.0; extra == 'payments'
Provides-Extra: realtime
Requires-Dist: uvicorn<1.0,>=0.53; extra == 'realtime'
Requires-Dist: websockets<17,>=13; extra == 'realtime'
Provides-Extra: rq
Requires-Dist: django-rq>=4.2.0; extra == 'rq'
Requires-Dist: hiredis>=2.0; extra == 'rq'
Requires-Dist: redis>=5.0; extra == 'rq'
Requires-Dist: rq<4.0,>=3.0.0; extra == 'rq'
Provides-Extra: s3
Requires-Dist: boto3<2.0,>=1.34; extra == 's3'
Requires-Dist: django-storages<2.0,>=1.14; extra == 's3'
Provides-Extra: test
Requires-Dist: django<6.2,>=5.2.14; extra == 'test'
Requires-Dist: factory-boy>=3.0; extra == 'test'
Requires-Dist: fakeredis>=2.0; extra == 'test'
Requires-Dist: import-linter>=2.0; extra == 'test'
Requires-Dist: pglast<9.0,>=7.0; extra == 'test'
Requires-Dist: pytest-cov>=4.0; extra == 'test'
Requires-Dist: pytest-django>=4.5; extra == 'test'
Requires-Dist: pytest-mock>=3.0; extra == 'test'
Requires-Dist: pytest-xdist>=3.0; extra == 'test'
Requires-Dist: pytest>=7.0; extra == 'test'
Description-Content-Type: text/markdown

<div align="center">

![Django CFG by CMDOP: Django, Frontend and Storybook in a Docker CFG workspace](https://raw.githubusercontent.com/commandoperator/cmdop-djangocfg/7c5ff03067d38fa93bb8302ecc63875dd14b2b20/assets/django-cfg-cmdop-hero.webp)

# Django CFG

[![PyPI](https://img.shields.io/pypi/v/django-cfg?logo=pypi&label=PyPI)](https://pypi.org/project/django-cfg/)
[![Python](https://img.shields.io/badge/Python-3.12%20%7C%203.13-3776AB?logo=python&logoColor=white)](https://www.python.org/)
[![Django](https://img.shields.io/badge/Django-5.2%20%7C%206.0%20%7C%206.1-092E20?logo=django&logoColor=white)](https://www.djangoproject.com/)
[![License](https://img.shields.io/badge/License-MIT-8B929A)](https://github.com/commandoperator/cmdop-djangocfg/blob/main/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](https://djangocfg.cmdop.ai/) ·
[Installation](https://djangocfg.cmdop.ai/getting-started/installation) ·
[Built-in apps](https://djangocfg.cmdop.ai/features/built-in-apps/overview) ·
[GitHub Issues](https://github.com/commandoperator/cmdop-djangocfg/issues)

</div>

---

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](https://github.com/commandoperator/cmdop-djangocfg/blob/main/assets/django-cfg-platform.svg).

| 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 <code>INSTALLED_APPS</code>. Core apps are
wired automatically; feature apps are enabled through typed configuration.
You do not manually copy their app paths into <code>project_apps</code>.

### Always available

| Application | Django app | Purpose |
|---|---|---|
| **Accounts** | <code>django_cfg.apps.system.accounts</code> | OTP sign-in, JWT, OAuth, API keys, profiles, login alerts and abuse protection |
| **TOTP** | <code>django_cfg.apps.system.totp</code> | Two-factor authentication and recovery codes |
| **Mailer** | <code>django_cfg.apps.system.mailer</code> | Localized email content, delivery workflow and send log |
| **Health API** | <code>django_cfg.apps.api.health</code> | Application health endpoints |
| **Commands API** | <code>django_cfg.apps.api.commands</code> | 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 |
|---|---|---|
| <code>currency</code> | <code>django_cfg.apps.tools.currency</code> | Currency rates and conversion |
| <code>geo</code> | <code>django_cfg.apps.tools.geo</code> | Countries, regions and cities |
| <code>analytics</code> | <code>django_cfg.apps.tools.analytics</code> | First-party pageviews, sessions and attribution; enabled by default |
| <code>chat</code> | <code>django_cfg.apps.tools.chat</code> | Ready-to-use conversation and message models/API |
| <code>payments</code> | <code>django_cfg.apps.payments</code> | Checkout, webhooks, refunds and Stripe-first provider integration |
| <code>simple_history</code> | <code>simple_history</code> | Model change history |
| <code>django_rq</code> | <code>django_cfg.modules.django_rq</code> + <code>django_rq</code> | Background jobs and scheduled tasks |
| <code>mcp</code> | <code>django_cfg.modules.django_mcp</code> | Permissioned application tools for MCP clients |
| <code>notion</code> | <code>django_cfg.modules.django_notion</code> | 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](https://djangocfg.cmdop.ai/features/built-in-apps/overview)
and [module documentation](https://djangocfg.cmdop.ai/features/modules/).

## Configuration stays readable

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

~~~python
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 <code>DJANGO_SECRET_KEY</code> in your secret manager or
environment. Do not commit it. Payments uses the optional Stripe dependency:

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

For the full set of configuration fields, defaults and environment variables,
use the [configuration reference](https://djangocfg.cmdop.ai/configuration/).

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

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

Create a standalone project:

~~~bash
django-cfg create-project myproject
cd myproject
~~~

Then follow the [installation guide](https://djangocfg.cmdop.ai/getting-started/installation)
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](https://djangocfg.cmdop.ai/features/api-generation/overview)
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](https://djangocfg.cmdop.ai/devops/quick-start),
[CMDOP integration guide](https://djangocfg.cmdop.ai/features/integrations/cmdop)
and [CMDOP documentation](https://docs.cmdop.ai/).

## Explore the documentation

| Start here | What you'll find |
|---|---|
| [Installation](https://djangocfg.cmdop.ai/getting-started/installation) | Create a project and configure its environment |
| [Configuration](https://djangocfg.cmdop.ai/configuration/) | Typed settings, database, cache, storage and security |
| [Built-in applications](https://djangocfg.cmdop.ai/features/built-in-apps/overview) | App inventory and feature switches |
| [API generation](https://djangocfg.cmdop.ai/features/api-generation/overview) | OpenAPI and multi-language clients |
| [Modules](https://djangocfg.cmdop.ai/features/modules/) | Optional framework modules and integrations |
| [Development environment](https://djangocfg.cmdop.ai/devops/quick-start) | 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
<code>solution/projects/frontend/apps/docs/content/</code>; there is no second
root <code>docs/</code> handbook.

- [Source code](https://github.com/commandoperator/cmdop-djangocfg)
- [Issues](https://github.com/commandoperator/cmdop-djangocfg/issues)
- [Contributing](CONTRIBUTING.md)
- [Changelog](CHANGELOG.md)
- [PyPI](https://pypi.org/project/django-cfg/)

## License

MIT. See [LICENSE](https://github.com/commandoperator/cmdop-djangocfg/blob/main/LICENSE). Django CFG is part of the CMDOP ecosystem;
Django and other third-party projects retain their own names and licenses.
