django-cfg 1.4.91__py3-none-any.whl → 1.4.93__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of django-cfg might be problematic. Click here for more details.
- django_cfg/__init__.py +1 -1
- django_cfg/apps/frontend/views.py +99 -16
- django_cfg/modules/django_client/management/commands/generate_client.py +7 -1
- django_cfg/modules/django_unfold/navigation.py +0 -1
- django_cfg/modules/nextjs_admin/views.py +33 -40
- django_cfg/pyproject.toml +3 -3
- django_cfg/static/frontend/nextjs_admin.zip +0 -0
- django_cfg/templates/admin/index.html +69 -7
- django_cfg/templatetags/django_cfg.py +74 -29
- {django_cfg-1.4.91.dist-info → django_cfg-1.4.93.dist-info}/METADATA +228 -171
- {django_cfg-1.4.91.dist-info → django_cfg-1.4.93.dist-info}/RECORD +14 -13
- {django_cfg-1.4.91.dist-info → django_cfg-1.4.93.dist-info}/WHEEL +0 -0
- {django_cfg-1.4.91.dist-info → django_cfg-1.4.93.dist-info}/entry_points.txt +0 -0
- {django_cfg-1.4.91.dist-info → django_cfg-1.4.93.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: django-cfg
|
|
3
|
-
Version: 1.4.
|
|
4
|
-
Summary: Django
|
|
3
|
+
Version: 1.4.93
|
|
4
|
+
Summary: Modern Django framework with type-safe Pydantic v2 configuration, Next.js admin integration, real-time WebSockets, and 8 enterprise apps. Replace settings.py with validated models, 90% less code. Production-ready with AI agents, auto-generated TypeScript clients, and zero-config features.
|
|
5
5
|
Project-URL: Homepage, https://djangocfg.com
|
|
6
6
|
Project-URL: Documentation, https://djangocfg.com
|
|
7
7
|
Project-URL: Repository, https://github.com/markolofsen/django-cfg
|
|
@@ -11,7 +11,7 @@ Author-email: Django-CFG Team <info@djangocfg.com>
|
|
|
11
11
|
Maintainer-email: Django-CFG Team <info@djangocfg.com>
|
|
12
12
|
License: MIT
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Keywords: ai-agents,configuration,django,django-environ,django-settings,enterprise-django,ide-autocomplete,pydantic,pydantic-settings,settings,startup-validation,type-safe-config,type-safety
|
|
14
|
+
Keywords: ai-agents,centrifugo,configuration,django,django-environ,django-settings,enterprise-django,ide-autocomplete,modern-django,nextjs-admin,pydantic,pydantic-settings,react-admin,real-time,settings,startup-validation,type-safe-config,type-safety,typescript-generation,websocket
|
|
15
15
|
Classifier: Development Status :: 4 - Beta
|
|
16
16
|
Classifier: Framework :: Django
|
|
17
17
|
Classifier: Framework :: Django :: 5.2
|
|
@@ -148,7 +148,7 @@ Requires-Dist: pytest-xdist<4.0,>=3.8; extra == 'test'
|
|
|
148
148
|
Requires-Dist: pytest<9.0,>=8.4; extra == 'test'
|
|
149
149
|
Description-Content-Type: text/markdown
|
|
150
150
|
|
|
151
|
-
# Django-CFG: Type-Safe Django Configuration Framework
|
|
151
|
+
# Django-CFG: Type-Safe Django Configuration Framework
|
|
152
152
|
|
|
153
153
|
[](https://www.python.org/downloads/)
|
|
154
154
|
[](https://www.djangoproject.com/)
|
|
@@ -165,119 +165,86 @@ Description-Content-Type: text/markdown
|
|
|
165
165
|
|
|
166
166
|
<div align="center">
|
|
167
167
|
|
|
168
|
-
### 🚀
|
|
168
|
+
### 🚀 The Modern Django Framework for Enterprise Applications
|
|
169
169
|
|
|
170
|
-
**Type-safe
|
|
170
|
+
**Type-safe configuration** • **Next.js Admin** • **AI Agents** • **Real-time WebSockets** • **8 Enterprise Apps**
|
|
171
171
|
|
|
172
|
-
**[
|
|
172
|
+
**[🎯 Live Demo](http://demo.djangocfg.com)** • **[📚 Documentation](https://djangocfg.com/docs/getting-started/intro)** • **[🐙 GitHub](https://github.com/markolofsen/django-cfg)**
|
|
173
173
|
|
|
174
174
|
</div>
|
|
175
175
|
|
|
176
|
-
## 🤖 AI Project Generator - Zero Setup Required
|
|
177
|
-
|
|
178
|
-
**Describe your app in plain English, get production-ready Django project in 30 seconds:**
|
|
179
|
-
|
|
180
|
-
> *"I need a SaaS app with user authentication, Stripe payments, and admin dashboard"*
|
|
181
|
-
|
|
182
|
-
**AI generates:** ✅ Type-safe config • ✅ Database models • ✅ REST API + docs • ✅ Modern UI • ✅ Deployment ready
|
|
183
|
-
|
|
184
|
-
### **[→ Try AI Editor Now](https://editor.djangocfg.com)**
|
|
185
|
-
|
|
186
176
|
---
|
|
187
177
|
|
|
188
|
-
## 🎯
|
|
178
|
+
## 🎯 What is Django-CFG?
|
|
189
179
|
|
|
190
|
-
**Django-CFG
|
|
180
|
+
**Django-CFG** is a next-generation Django framework that replaces traditional `settings.py` with **type-safe Pydantic v2 models**. It eliminates runtime configuration errors, provides complete IDE autocomplete, and includes **production-ready enterprise features** out of the box.
|
|
191
181
|
|
|
192
|
-
### Why
|
|
182
|
+
### Why Django-CFG?
|
|
193
183
|
|
|
194
|
-
**Traditional Django
|
|
195
|
-
- ❌ **Runtime errors** -
|
|
196
|
-
- ❌ **No IDE support** - zero autocomplete, manual
|
|
197
|
-
- ❌ **200+ lines**
|
|
198
|
-
- ❌ **
|
|
184
|
+
**Traditional Django problems:**
|
|
185
|
+
- ❌ **Runtime errors** - configuration bugs discovered in production
|
|
186
|
+
- ❌ **No IDE support** - zero autocomplete, manual documentation lookup
|
|
187
|
+
- ❌ **200+ lines** of unmaintainable settings.py
|
|
188
|
+
- ❌ **Weeks of setup** - for user auth, admin UI, payments, real-time features
|
|
199
189
|
|
|
200
|
-
**Django-CFG
|
|
201
|
-
- ✅ **
|
|
202
|
-
- ✅ **Full IDE autocomplete** - IntelliSense for
|
|
190
|
+
**Django-CFG solution:**
|
|
191
|
+
- ✅ **Startup validation** - catch all config errors before deployment
|
|
192
|
+
- ✅ **Full IDE autocomplete** - IntelliSense for every setting
|
|
203
193
|
- ✅ **30 lines of code** - 90% boilerplate reduction
|
|
204
|
-
- ✅ **
|
|
194
|
+
- ✅ **30 seconds to production** - everything included and ready
|
|
205
195
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
| Feature | settings.py | django-environ | pydantic-settings | **Django-CFG** |
|
|
209
|
-
|---------|-------------|----------------|-------------------|----------------|
|
|
210
|
-
| **Type Safety** | ❌ Runtime only | ⚠️ Basic casting | ✅ Pydantic | ✅ **Full Pydantic v2** |
|
|
211
|
-
| **IDE Autocomplete** | ❌ None | ❌ None | ⚠️ Partial | ✅ **100%** |
|
|
212
|
-
| **Startup Validation** | ❌ No | ⚠️ Partial | ✅ Yes | ✅ **Yes + Custom validators** |
|
|
213
|
-
| **Django Integration** | ✅ Native | ⚠️ Partial | ❌ Manual | ✅ **Seamless** |
|
|
214
|
-
| **Built-in Apps** | ❌ Build yourself | ❌ None | ❌ None | ✅ **8 enterprise apps** |
|
|
215
|
-
| **AI-Ready** | ❌ Manual setup | ❌ None | ❌ None | ✅ **LLM + Vector DB** |
|
|
216
|
-
|
|
217
|
-
**[📚 Full comparison guide →](https://djangocfg.com/docs/getting-started/django-cfg-vs-alternatives)**
|
|
196
|
+
**[📚 Read the full comparison →](https://djangocfg.com/docs/getting-started/django-cfg-vs-alternatives)**
|
|
218
197
|
|
|
219
198
|
---
|
|
220
199
|
|
|
221
|
-
## 🚀
|
|
222
|
-
|
|
223
|
-
### Option 1: AI Editor (Fastest - 30 seconds) ⚡
|
|
224
|
-
|
|
225
|
-
**Generate project with AI - no installation needed:**
|
|
200
|
+
## 🚀 Quick Start
|
|
226
201
|
|
|
227
|
-
|
|
228
|
-
2. Describe your app in plain English
|
|
229
|
-
3. Download ready-to-deploy project
|
|
230
|
-
|
|
231
|
-
**[→ Generate with AI](https://editor.djangocfg.com)**
|
|
232
|
-
|
|
233
|
-
---
|
|
234
|
-
|
|
235
|
-
### Option 2: Traditional CLI
|
|
202
|
+
### Installation
|
|
236
203
|
|
|
237
204
|
```bash
|
|
238
205
|
pip install django-cfg
|
|
239
|
-
django-cfg create-project "My
|
|
240
|
-
cd my-
|
|
206
|
+
django-cfg create-project "My App"
|
|
207
|
+
cd my-app && python manage.py runserver
|
|
241
208
|
```
|
|
242
209
|
|
|
243
210
|
**What you get instantly:**
|
|
244
|
-
- 🎨 Modern Admin UI → `http://127.0.0.1:8000/admin/`
|
|
245
|
-
-
|
|
246
|
-
-
|
|
211
|
+
- 🎨 **Modern Admin UI** → `http://127.0.0.1:8000/admin/`
|
|
212
|
+
- ⚡ **Next.js Dashboard** (optional) → Modern React admin interface
|
|
213
|
+
- 📡 **Real-time WebSockets** → Live updates with Centrifugo
|
|
214
|
+
- 🚀 **Production-ready** → Type-safe config, security hardened
|
|
247
215
|
|
|
248
216
|
<div align="center">
|
|
249
217
|
<img src="https://raw.githubusercontent.com/markolofsen/django-cfg/refs/heads/main/static/startup.png" alt="Django-CFG Startup Screen" width="800">
|
|
250
|
-
<p><em>Django-CFG startup
|
|
218
|
+
<p><em>Django-CFG startup with type-safe configuration validation</em></p>
|
|
251
219
|
</div>
|
|
252
220
|
|
|
253
221
|
**[📚 Installation Guide →](https://djangocfg.com/docs/getting-started/installation)**
|
|
254
222
|
|
|
255
223
|
---
|
|
256
224
|
|
|
257
|
-
###
|
|
225
|
+
### Try Live Demo
|
|
258
226
|
|
|
259
|
-
**See
|
|
227
|
+
**See Django-CFG in action:**
|
|
260
228
|
|
|
261
|
-
|
|
229
|
+
**[→ http://demo.djangocfg.com](http://demo.djangocfg.com)**
|
|
262
230
|
|
|
263
231
|
**Demo credentials:**
|
|
264
232
|
- **Admin:** `demo@djangocfg.com` / `demo2024`
|
|
265
233
|
- **User:** `user@djangocfg.com` / `user2024`
|
|
266
234
|
|
|
267
|
-
**
|
|
235
|
+
**Explore:** Modern admin • Next.js dashboard • AI agents • Real-time updates • Support system
|
|
268
236
|
|
|
269
237
|
---
|
|
270
238
|
|
|
271
239
|
## 💡 Core Features
|
|
272
240
|
|
|
273
|
-
### 🔒 Type-Safe
|
|
274
|
-
|
|
275
|
-
**Replace Django's settings.py with Pydantic v2 for complete type safety, IDE autocomplete, and startup validation.**
|
|
241
|
+
### 🔒 Type-Safe Configuration with Pydantic v2
|
|
276
242
|
|
|
277
|
-
|
|
243
|
+
**Replace error-prone settings.py with validated Pydantic models.**
|
|
278
244
|
|
|
245
|
+
#### Before: Django settings.py
|
|
279
246
|
```python
|
|
280
|
-
# settings.py -
|
|
247
|
+
# settings.py - Runtime errors, no validation
|
|
281
248
|
import os
|
|
282
249
|
|
|
283
250
|
DEBUG = os.getenv('DEBUG', 'False') == 'True' # ❌ String comparison bug
|
|
@@ -290,98 +257,164 @@ DATABASES = {
|
|
|
290
257
|
'PORT': DATABASE_PORT, # ❌ Type mismatch in production
|
|
291
258
|
}
|
|
292
259
|
}
|
|
293
|
-
# ... 200+ more lines
|
|
260
|
+
# ... 200+ more lines
|
|
294
261
|
```
|
|
295
262
|
|
|
296
|
-
#### After: Django-CFG
|
|
297
|
-
|
|
263
|
+
#### After: Django-CFG
|
|
298
264
|
```python
|
|
299
|
-
# config.py - Type-safe
|
|
300
|
-
from django_cfg import DjangoConfig
|
|
301
|
-
from django_cfg.models import DatabaseConfig
|
|
265
|
+
# config.py - Type-safe, validated at startup
|
|
266
|
+
from django_cfg import DjangoConfig, DatabaseConfig
|
|
302
267
|
|
|
303
268
|
class MyConfig(DjangoConfig):
|
|
304
|
-
"""Production-
|
|
269
|
+
"""Production-ready type-safe configuration"""
|
|
305
270
|
|
|
306
|
-
project_name: str = "My
|
|
307
|
-
debug: bool = False # ✅ Pydantic validates boolean
|
|
271
|
+
project_name: str = "My App"
|
|
272
|
+
debug: bool = False # ✅ Pydantic validates boolean
|
|
308
273
|
|
|
309
|
-
# Type-safe database
|
|
274
|
+
# Type-safe database with startup validation
|
|
310
275
|
databases: dict[str, DatabaseConfig] = {
|
|
311
276
|
"default": DatabaseConfig(
|
|
312
|
-
name="${DB_NAME}",
|
|
313
|
-
port=5432,
|
|
277
|
+
name="${DB_NAME}", # ✅ Validated at startup
|
|
278
|
+
port=5432, # ✅ Type-checked integer
|
|
314
279
|
)
|
|
315
280
|
}
|
|
316
281
|
```
|
|
317
282
|
|
|
318
|
-
**
|
|
319
|
-
- ✅ **Pydantic v2 validation** - catch
|
|
320
|
-
- ✅ **Full IDE autocomplete** - IntelliSense
|
|
321
|
-
- ✅ **90% less code** -
|
|
322
|
-
- ✅ **Type hints
|
|
283
|
+
**Benefits:**
|
|
284
|
+
- ✅ **Pydantic v2 validation** - catch errors before deployment
|
|
285
|
+
- ✅ **Full IDE autocomplete** - IntelliSense everywhere
|
|
286
|
+
- ✅ **90% less code** - 200+ lines → 30 lines
|
|
287
|
+
- ✅ **Type hints** - mypy and pyright compatible
|
|
288
|
+
|
|
289
|
+
**[📚 Type-safe configuration guide →](https://djangocfg.com/docs/fundamentals/core/type-safety)**
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
### ⚛️ Next.js Admin Integration
|
|
294
|
+
|
|
295
|
+
**Build modern admin interfaces with React** - the only Django framework with built-in Next.js integration.
|
|
296
|
+
|
|
297
|
+
```python
|
|
298
|
+
from django_cfg import DjangoConfig, NextJsAdminConfig
|
|
299
|
+
|
|
300
|
+
class MyConfig(DjangoConfig):
|
|
301
|
+
# One line for complete Next.js admin!
|
|
302
|
+
nextjs_admin: NextJsAdminConfig = NextJsAdminConfig(
|
|
303
|
+
project_path="../admin",
|
|
304
|
+
)
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
**What you get:**
|
|
308
|
+
- 🌐 **Three-in-One Architecture** - Public site + User dashboard + Admin panel in ONE Next.js project
|
|
309
|
+
- ⚙️ **Dual Admin Strategy** - Django Unfold (90% quick CRUD) + Next.js (10% complex features)
|
|
310
|
+
- ✨ **Zero Configuration** - Auto JWT auth, theme sync, TypeScript generation
|
|
311
|
+
- 📦 **60% Smaller** - ZIP deployment (~7MB vs ~20MB)
|
|
312
|
+
- ⚡ **Auto-Detection** - Dev mode automatically detected on ports 3000/3001
|
|
313
|
+
|
|
314
|
+
**No migration needed** - start with built-in admin, add Next.js when you need complex features!
|
|
323
315
|
|
|
324
|
-
**[📚
|
|
316
|
+
**[📚 Next.js Admin Documentation →](https://djangocfg.com/docs/features/integrations/nextjs-admin)**
|
|
325
317
|
|
|
326
318
|
---
|
|
327
319
|
|
|
328
|
-
###
|
|
320
|
+
### 📡 Real-Time WebSockets with Centrifugo
|
|
329
321
|
|
|
330
|
-
**
|
|
322
|
+
**Production-ready WebSocket integration** - live updates, notifications, and real-time collaboration.
|
|
323
|
+
|
|
324
|
+
```python
|
|
325
|
+
from django_cfg import DjangoConfig, CentrifugoConfig
|
|
326
|
+
|
|
327
|
+
class MyConfig(DjangoConfig):
|
|
328
|
+
# Enable real-time features
|
|
329
|
+
centrifugo: CentrifugoConfig = CentrifugoConfig(
|
|
330
|
+
enabled=True,
|
|
331
|
+
api_url="http://localhost:8001/api",
|
|
332
|
+
)
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
**Built-in features:**
|
|
336
|
+
- ⚡ **Live Updates** - Real-time data synchronization
|
|
337
|
+
- 🔔 **Notifications** - Push notifications to connected clients
|
|
338
|
+
- 👥 **Presence** - Track online users
|
|
339
|
+
- 💬 **Chat** - Real-time messaging out of the box
|
|
340
|
+
- 🔒 **JWT Auth** - Secure WebSocket connections
|
|
341
|
+
|
|
342
|
+
**[📚 Centrifugo Integration Guide →](https://djangocfg.com/docs/features/integrations/centrifugo)**
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
### 🤖 AI-Ready Infrastructure
|
|
347
|
+
|
|
348
|
+
**Built-in AI agent framework** - LLM workflow automation with Django ORM integration.
|
|
331
349
|
|
|
332
350
|
```python
|
|
333
351
|
from django_cfg import DjangoConfig
|
|
334
352
|
|
|
335
353
|
class MyConfig(DjangoConfig):
|
|
336
|
-
# AI
|
|
354
|
+
# AI features (optional)
|
|
337
355
|
openai_api_key: str = "${OPENAI_API_KEY}"
|
|
338
356
|
anthropic_api_key: str = "${ANTHROPIC_API_KEY}"
|
|
339
357
|
|
|
340
|
-
#
|
|
341
|
-
|
|
342
|
-
enable_knowbase: bool = True # Vector database + RAG
|
|
358
|
+
enable_agents: bool = True # AI workflow automation
|
|
359
|
+
enable_knowbase: bool = True # Vector DB + RAG
|
|
343
360
|
```
|
|
344
361
|
|
|
345
|
-
**
|
|
346
|
-
- 🤖 **AI Agents Framework** - Type-safe
|
|
347
|
-
- 📚 **Vector Database** - ChromaDB semantic search
|
|
348
|
-
- 🔍 **RAG
|
|
349
|
-
- 🎯 **Pydantic AI** -
|
|
350
|
-
- 🌐 **Multi-LLM** - OpenAI, Anthropic, Claude
|
|
362
|
+
**Features:**
|
|
363
|
+
- 🤖 **AI Agents Framework** - Type-safe LLM integration
|
|
364
|
+
- 📚 **Vector Database** - ChromaDB for semantic search
|
|
365
|
+
- 🔍 **RAG** - Retrieval-augmented generation
|
|
366
|
+
- 🎯 **Pydantic AI** - Validated AI input/output
|
|
367
|
+
- 🌐 **Multi-LLM** - OpenAI, Anthropic, Claude support
|
|
351
368
|
|
|
352
|
-
**[📚
|
|
369
|
+
**[📚 AI Agents Guide →](https://djangocfg.com/docs/ai-agents/introduction)**
|
|
353
370
|
|
|
354
371
|
---
|
|
355
372
|
|
|
356
|
-
### 📦 8
|
|
373
|
+
### 📦 8 Enterprise Apps Included
|
|
357
374
|
|
|
358
|
-
**Ship features in days, not months** -
|
|
375
|
+
**Ship features in days, not months** - production-ready apps out of the box:
|
|
359
376
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
377
|
+
| App | Description | Time Saved |
|
|
378
|
+
|-----|-------------|------------|
|
|
379
|
+
| 👤 **Accounts** | User management + OTP + SMS auth | 3-4 weeks |
|
|
380
|
+
| 🎫 **Support** | Ticketing system + SLA tracking | 2-3 weeks |
|
|
381
|
+
| 📧 **Newsletter** | Email campaigns + analytics | 2-3 weeks |
|
|
382
|
+
| 📊 **Leads** | CRM + sales pipeline | 2-3 weeks |
|
|
383
|
+
| 🤖 **AI Agents** | Workflow automation | 3-4 weeks |
|
|
384
|
+
| 📚 **KnowBase** | AI knowledge base + RAG | 2-3 weeks |
|
|
385
|
+
| 💳 **Payments** | Multi-provider payments | 2-3 weeks |
|
|
386
|
+
| 🔧 **Maintenance** | Multi-site management | 1-2 weeks |
|
|
368
387
|
|
|
369
|
-
**Total time saved: 18 months of development**
|
|
388
|
+
**Total time saved: 18+ months of development**
|
|
370
389
|
|
|
371
|
-
|
|
390
|
+
```python
|
|
391
|
+
class MyConfig(DjangoConfig):
|
|
392
|
+
# Enable apps as needed (one line each!)
|
|
393
|
+
enable_accounts: bool = True
|
|
394
|
+
enable_support: bool = True
|
|
395
|
+
enable_newsletter: bool = True
|
|
396
|
+
enable_leads: bool = True
|
|
397
|
+
enable_agents: bool = True
|
|
398
|
+
enable_knowbase: bool = True
|
|
399
|
+
enable_payments: bool = True
|
|
400
|
+
enable_maintenance: bool = True
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
**[📚 Built-in Apps Overview →](https://djangocfg.com/docs/features/built-in-apps/overview)**
|
|
372
404
|
|
|
373
405
|
---
|
|
374
406
|
|
|
375
407
|
### 🎨 Modern API UI with Tailwind 4
|
|
376
408
|
|
|
377
|
-
**Beautiful browsable API** - 88% smaller bundle,
|
|
409
|
+
**Beautiful browsable API** - 88% smaller bundle, modern design.
|
|
378
410
|
|
|
379
411
|
- ✅ Glass morphism design
|
|
380
412
|
- ✅ Light/Dark/Auto themes
|
|
381
413
|
- ✅ Command palette (⌘K)
|
|
382
|
-
- ✅ 88% smaller
|
|
414
|
+
- ✅ 88% smaller (278KB → 33KB)
|
|
415
|
+
- ✅ Auto-generated TypeScript clients
|
|
383
416
|
|
|
384
|
-
**[📚
|
|
417
|
+
**[📚 API Generation Guide →](https://djangocfg.com/docs/features/api-generation/overview)**
|
|
385
418
|
|
|
386
419
|
---
|
|
387
420
|
|
|
@@ -390,43 +423,58 @@ class MyConfig(DjangoConfig):
|
|
|
390
423
|
**Zero-config database routing** with automatic sharding:
|
|
391
424
|
|
|
392
425
|
```python
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}
|
|
426
|
+
from django_cfg import DjangoConfig, DatabaseConfig
|
|
427
|
+
|
|
428
|
+
class MyConfig(DjangoConfig):
|
|
429
|
+
databases: dict[str, DatabaseConfig] = {
|
|
430
|
+
"default": DatabaseConfig(
|
|
431
|
+
name="${DB_NAME}",
|
|
432
|
+
),
|
|
433
|
+
"analytics": DatabaseConfig(
|
|
434
|
+
name="${ANALYTICS_DB}",
|
|
435
|
+
routing_apps=["analytics", "reports"], # Auto-route!
|
|
436
|
+
),
|
|
437
|
+
}
|
|
399
438
|
```
|
|
400
439
|
|
|
401
440
|
✅ Auto-routes read/write • ✅ Cross-DB transactions • ✅ Connection pooling
|
|
402
441
|
|
|
403
|
-
**[📚 Multi-
|
|
442
|
+
**[📚 Multi-Database Guide →](https://djangocfg.com/docs/fundamentals/database/multi-database)**
|
|
404
443
|
|
|
405
444
|
---
|
|
406
445
|
|
|
407
446
|
## ⚙️ Complete Configuration Example
|
|
408
447
|
|
|
409
|
-
**All
|
|
448
|
+
**All features in one DjangoConfig:**
|
|
410
449
|
|
|
411
450
|
```python
|
|
412
|
-
from django_cfg import DjangoConfig
|
|
413
|
-
from django_cfg.models import DatabaseConfig, CacheConfig
|
|
451
|
+
from django_cfg import DjangoConfig, DatabaseConfig, CacheConfig, NextJsAdminConfig
|
|
414
452
|
|
|
415
453
|
class ProductionConfig(DjangoConfig):
|
|
416
|
-
# Project
|
|
454
|
+
# Project
|
|
417
455
|
project_name: str = "My Enterprise App"
|
|
418
456
|
secret_key: str = "${SECRET_KEY}"
|
|
419
457
|
debug: bool = False
|
|
420
458
|
|
|
421
|
-
#
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
459
|
+
# Next.js Admin (optional)
|
|
460
|
+
nextjs_admin: NextJsAdminConfig = NextJsAdminConfig(
|
|
461
|
+
project_path="../admin",
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
# Real-time WebSockets (optional)
|
|
465
|
+
centrifugo: CentrifugoConfig = CentrifugoConfig(
|
|
466
|
+
enabled=True,
|
|
467
|
+
)
|
|
468
|
+
|
|
469
|
+
# 8 Enterprise Apps (enable as needed)
|
|
470
|
+
enable_accounts: bool = True # User management
|
|
471
|
+
enable_support: bool = True # Ticketing
|
|
472
|
+
enable_newsletter: bool = True # Email campaigns
|
|
473
|
+
enable_leads: bool = True # CRM
|
|
474
|
+
enable_agents: bool = True # AI automation
|
|
475
|
+
enable_knowbase: bool = True # Vector DB
|
|
476
|
+
enable_payments: bool = True # Payments
|
|
477
|
+
enable_maintenance: bool = True # Site management
|
|
430
478
|
|
|
431
479
|
# Infrastructure
|
|
432
480
|
databases: dict[str, DatabaseConfig] = {
|
|
@@ -440,75 +488,84 @@ class ProductionConfig(DjangoConfig):
|
|
|
440
488
|
openai_api_key: str = "${OPENAI_API_KEY}"
|
|
441
489
|
anthropic_api_key: str = "${ANTHROPIC_API_KEY}"
|
|
442
490
|
|
|
443
|
-
#
|
|
444
|
-
twilio_account_sid: str = "${TWILIO_ACCOUNT_SID}"
|
|
445
|
-
stripe_api_key: str = "${STRIPE_API_KEY}"
|
|
446
|
-
cloudflare_api_token: str = "${CF_API_TOKEN}"
|
|
491
|
+
# Integrations
|
|
492
|
+
twilio_account_sid: str = "${TWILIO_ACCOUNT_SID}"
|
|
493
|
+
stripe_api_key: str = "${STRIPE_API_KEY}"
|
|
494
|
+
cloudflare_api_token: str = "${CF_API_TOKEN}"
|
|
447
495
|
```
|
|
448
496
|
|
|
449
|
-
**[📚
|
|
497
|
+
**[📚 Configuration Reference →](https://djangocfg.com/docs/getting-started/configuration)**
|
|
450
498
|
|
|
451
499
|
---
|
|
452
500
|
|
|
453
|
-
## 📊
|
|
501
|
+
## 📊 Comparison with Alternatives
|
|
454
502
|
|
|
455
|
-
|
|
503
|
+
### Django-CFG vs Traditional Solutions
|
|
456
504
|
|
|
457
|
-
| Feature |
|
|
458
|
-
|
|
459
|
-
| **Type
|
|
460
|
-
| **IDE Autocomplete** | ❌ None | ❌ None |
|
|
461
|
-
| **Startup Validation** | ❌ No | ⚠️ Partial |
|
|
462
|
-
| **
|
|
463
|
-
| **
|
|
464
|
-
| **
|
|
465
|
-
| **AI
|
|
466
|
-
| **Setup Time** | 🟡 Weeks | 🟡 Hours | 🟡
|
|
467
|
-
| **
|
|
468
|
-
| **Configuration Lines** | ⚠️ 200+ | ⚠️ 150+ | ⚠️ 200+ | ⚠️ 100+ | ✅ **30 lines** |
|
|
505
|
+
| Feature | settings.py | django-environ | pydantic-settings | **Django-CFG** |
|
|
506
|
+
|---------|-------------|----------------|-------------------|----------------|
|
|
507
|
+
| **Type Safety** | ❌ Runtime | ⚠️ Basic | ✅ Pydantic | ✅ **Full Pydantic v2** |
|
|
508
|
+
| **IDE Autocomplete** | ❌ None | ❌ None | ⚠️ Partial | ✅ **100%** |
|
|
509
|
+
| **Startup Validation** | ❌ No | ⚠️ Partial | ✅ Yes | ✅ **Yes + Custom** |
|
|
510
|
+
| **Next.js Admin** | ❌ Manual | ❌ None | ❌ None | ✅ **Built-in** |
|
|
511
|
+
| **WebSocket (Centrifugo)** | ❌ Manual | ❌ None | ❌ None | ✅ **Built-in** |
|
|
512
|
+
| **Enterprise Apps** | ❌ Build all | ❌ None | ❌ None | ✅ **8 included** |
|
|
513
|
+
| **AI Framework** | ❌ Manual | ❌ None | ❌ None | ✅ **Built-in** |
|
|
514
|
+
| **Setup Time** | 🟡 Weeks | 🟡 Hours | 🟡 Days | ✅ **30 seconds** |
|
|
515
|
+
| **Config Lines** | ⚠️ 200+ | ⚠️ 150+ | ⚠️ 100+ | ✅ **30 lines** |
|
|
469
516
|
|
|
470
517
|
**Legend:** ✅ Excellent | 🟡 Requires Work | ⚠️ Partial | ❌ Not Available
|
|
471
518
|
|
|
472
|
-
**[📚
|
|
519
|
+
**[📚 Detailed Comparison Guide →](https://djangocfg.com/docs/getting-started/django-cfg-vs-alternatives)**
|
|
473
520
|
|
|
474
521
|
---
|
|
475
522
|
|
|
476
523
|
## 📚 Documentation
|
|
477
524
|
|
|
478
525
|
### 🚀 Getting Started
|
|
479
|
-
- **[Installation](https://djangocfg.com/docs/getting-started/installation)** - Quick setup
|
|
526
|
+
- **[Installation](https://djangocfg.com/docs/getting-started/installation)** - Quick setup
|
|
480
527
|
- **[First Project](https://djangocfg.com/docs/getting-started/first-project)** - Create your first app
|
|
481
|
-
- **[Configuration](https://djangocfg.com/docs/getting-started/configuration)** - Type-safe config
|
|
528
|
+
- **[Configuration](https://djangocfg.com/docs/getting-started/configuration)** - Type-safe config
|
|
482
529
|
- **[Why Django-CFG?](https://djangocfg.com/docs/getting-started/why-django-cfg)** - Full comparison
|
|
483
530
|
|
|
531
|
+
### ⚛️ Next.js Integration
|
|
532
|
+
- **[Overview](https://djangocfg.com/docs/features/integrations/nextjs-admin)** - Three-in-One architecture
|
|
533
|
+
- **[Core Concepts](https://djangocfg.com/docs/features/integrations/nextjs-admin/concepts)** - Philosophy & design
|
|
534
|
+
- **[Quick Start](https://djangocfg.com/docs/features/integrations/nextjs-admin/quick-start)** - 5-minute setup
|
|
535
|
+
- **[Configuration](https://djangocfg.com/docs/features/integrations/nextjs-admin/configuration)** - All options
|
|
536
|
+
|
|
537
|
+
### 📡 Real-Time Features
|
|
538
|
+
- **[Centrifugo Integration](https://djangocfg.com/docs/features/integrations/centrifugo)** - WebSocket setup
|
|
539
|
+
- **[Live Updates](https://djangocfg.com/docs/features/integrations/centrifugo/live-updates)** - Real-time data
|
|
540
|
+
|
|
484
541
|
### 🏗️ Core Features
|
|
485
|
-
- **[Built-in Apps](https://djangocfg.com/docs/features/built-in-apps)** - 8 enterprise apps
|
|
486
|
-
- **[API Generation](https://djangocfg.com/docs/features/api-generation)** - Auto
|
|
487
|
-
- **[Database](https://djangocfg.com/docs/fundamentals/database)** - Multi-DB routing
|
|
488
|
-
- **[
|
|
542
|
+
- **[Built-in Apps](https://djangocfg.com/docs/features/built-in-apps/overview)** - 8 enterprise apps
|
|
543
|
+
- **[API Generation](https://djangocfg.com/docs/features/api-generation/overview)** - Auto TypeScript clients
|
|
544
|
+
- **[Database](https://djangocfg.com/docs/fundamentals/database/multi-database)** - Multi-DB routing
|
|
545
|
+
- **[Type Safety](https://djangocfg.com/docs/fundamentals/core/type-safety)** - Pydantic validation
|
|
489
546
|
|
|
490
|
-
### 🤖 AI
|
|
547
|
+
### 🤖 AI Features (Optional)
|
|
491
548
|
- **[AI Agents](https://djangocfg.com/docs/ai-agents/introduction)** - Workflow automation
|
|
492
549
|
- **[Creating Agents](https://djangocfg.com/docs/ai-agents/creating-agents)** - Build custom agents
|
|
493
|
-
- **[Django Integration](https://djangocfg.com/docs/ai-agents/django-integration)** -
|
|
550
|
+
- **[Django Integration](https://djangocfg.com/docs/ai-agents/django-integration)** - ORM integration
|
|
494
551
|
|
|
495
552
|
### 🚀 Deployment
|
|
496
|
-
- **[Production Config](https://djangocfg.com/docs/deployment)** -
|
|
497
|
-
- **[CLI Commands](https://djangocfg.com/docs/cli)** - 50+
|
|
553
|
+
- **[Production Config](https://djangocfg.com/docs/deployment)** - Best practices
|
|
554
|
+
- **[CLI Commands](https://djangocfg.com/docs/cli)** - 50+ commands
|
|
498
555
|
|
|
499
556
|
---
|
|
500
557
|
|
|
501
558
|
## 🤝 Community & Support
|
|
502
559
|
|
|
503
560
|
### Resources
|
|
504
|
-
- 🌐 **[djangocfg.com](https://djangocfg.com/)** - Official website &
|
|
561
|
+
- 🌐 **[djangocfg.com](https://djangocfg.com/)** - Official website & docs
|
|
505
562
|
- 🐙 **[GitHub](https://github.com/markolofsen/django-cfg)** - Source code & issues
|
|
506
563
|
- 💬 **[Discussions](https://github.com/markolofsen/django-cfg/discussions)** - Community support
|
|
507
564
|
|
|
508
565
|
### Links
|
|
509
|
-
- **[🚀 AI Project Generator](https://editor.djangocfg.com)** - Generate projects with AI
|
|
510
566
|
- **[🎯 Live Demo](http://demo.djangocfg.com)** - See it in action
|
|
511
567
|
- **[📦 PyPI](https://pypi.org/project/django-cfg/)** - Package repository
|
|
568
|
+
- **[📚 Documentation](https://djangocfg.com/docs)** - Complete guides
|
|
512
569
|
|
|
513
570
|
---
|
|
514
571
|
|
|
@@ -524,12 +581,12 @@ class ProductionConfig(DjangoConfig):
|
|
|
524
581
|
|
|
525
582
|
<div align="center">
|
|
526
583
|
|
|
527
|
-
**Django
|
|
584
|
+
**Modern Django Framework** • **Type-Safe Configuration** • **Next.js Admin** • **Real-Time WebSockets** • **AI-Ready**
|
|
528
585
|
|
|
529
|
-
Django-CFG is the
|
|
586
|
+
Django-CFG is the modern Django framework for enterprise applications. Built with Pydantic v2 for type-safe configuration, includes Next.js admin integration, Centrifugo WebSocket support, AI agent framework, and 8 production-ready apps. Perfect for building scalable Django applications with reduced boilerplate and enterprise features out of the box.
|
|
530
587
|
|
|
531
588
|
---
|
|
532
589
|
|
|
533
|
-
**Get Started:** **[Documentation](https://djangocfg.com/docs/getting-started/intro)** • **[
|
|
590
|
+
**Get Started:** **[Documentation](https://djangocfg.com/docs/getting-started/intro)** • **[Live Demo](http://demo.djangocfg.com)** • **[GitHub](https://github.com/markolofsen/django-cfg)**
|
|
534
591
|
|
|
535
592
|
</div>
|