TopRank Skills

Home / Claw Skills / 开发运维 / Afrexai Django Production
Official OpenClaw rules 54%

Afrexai Django Production

Django Production Engineering

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 Afrexai Django Production 技能。 若已安装,则直接安装 Afrexai Django Production 技能。

Overview

Skill Key
1kalin/afrexai-django-production
Author
1kalin
Source Repo
openclaw/skills
Version
-
Source Path
skills/1kalin/afrexai-django-production
Latest Commit SHA
22143a855e75333aa1d3a16c20e2a29803ad197a

Extracted Content

SKILL.md excerpt

# Django Production Engineering

Complete methodology for building, scaling, and operating production Django applications. From project structure to deployment, security to performance — every decision framework a Django team needs.

## Quick Health Check

Run this 8-signal triage on any Django project:

| # | Signal | Check | Healthy |
|---|--------|-------|---------|
| 1 | Settings split | `settings/base.py`, `local.py`, `production.py` exist | ✅ Split by env |
| 2 | Secret management | `SECRET_KEY` not in code, `DEBUG=False` in prod | ✅ Env vars / vault |
| 3 | Database | Using connection pooling (pgbouncer / django-db-conn-pool) | ✅ Pool configured |
| 4 | Migrations | `python manage.py showmigrations` — no unapplied | ✅ All applied |
| 5 | Static files | `collectstatic` + CDN/whitenoise configured | ✅ Served properly |
| 6 | Async tasks | Celery/django-q/Huey for background work | ✅ Not blocking views |
| 7 | Caching | Cache backend configured (Redis/Memcached) | ✅ Not DummyCache |
| 8 | Security | `python manage.py check --deploy` passes | ✅ All checks pass |

**Score: count ✅ / 8** — Below 6 = stop and fix foundations first.

---

## Phase 1: Project Architecture

### Recommended Structure

```
myproject/
├── config/                    # Project config (was myproject/)
│   ├── __init__.py
│   ├── settings/
│   │   ├── __init__.py
│   │   ├── base.py           # Shared settings
│   │   ├── local.py          # Development
│   │   ├── staging.py        # Staging
│   │   └── production.py     # Production
│   ├── urls.py               # Root URL conf
│   ├── wsgi.py
│   ├── asgi.py
│   └── celery.py             # Celery app
├── apps/
│   ├── users/                # Custom user model (ALWAYS)
│   │   ├── models.py
│   │   ├── managers.py
│   │   ├── admin.py
│   │   ├── serializers.py
│   │   ├── views.py
│   │   ├── urls.py
│   │   ├── services.py       # Business logic
│   │   ├── selectors.py      # Complex queries
│   │   ├── tests/
│   │   │   ├── te...

README excerpt

# Django Production Engineering 🐍

The complete Django production methodology — from project architecture to deployment. Not another tutorial. A battle-tested operating system for building, scaling, and shipping production Django applications.

## What's Inside

- **12-phase production system** — architecture → ORM mastery → DRF → auth → migrations → caching → Celery → testing → performance → deployment → patterns → Django 5.x
- **8-signal health check** — score any Django project in 60 seconds
- **ORM deep dive** — N+1 prevention, bulk operations, F() expressions, index strategy, QuerySet evaluation rules
- **DRF best practices** — service layer pattern, separate read/write serializers, cursor pagination
- **Zero-downtime migrations** — 3-step nullable pattern, safety rules, conflict resolution
- **Production Celery** — retry with backoff, time limits, idempotent tasks, queue separation
- **Security hardening** — 10-point checklist, JWT setup, RBAC permissions, CSP headers
- **Testing strategy** — pytest-django, factories, service testing, CI coverage enforcement
- **Deployment** — multi-stage Dockerfile, Gunicorn config, GitHub Actions CI/CD, production checklist
- **100-point quality rubric** across 8 dimensions
- **10 common mistakes** with fixes
- **Django 5.x features** — GeneratedField, db_default, field groups

## Install

```bash
clawhub install afrexai-django-production
```

## Quick Start

Ask your agent:
- "Review this Django project" — instant /8 health score
- "Optimize these queries" — N+1 fixes + index recommendations
- "Set up DRF for this model" — full serializer + view + URL + test generation
- "Production checklist" — P0/P1 audit with specific fixes

## ⚡ Level Up

Take your Django backend to the next level with an **AfrexAI Context Pack** ($47) — deep industry context for AI agents building production systems:

- **[SaaS Context Pack](https://afrexai-cto.github.io/context-packs/)** — multi-tenancy, billing, onboarding flows
- **[Fintech Contex...

Related Claw Skills