Python Django Architecture

Use when the user asks about Django, Django ORM queries that are slow, select_related and prefetch_related, Django REST framework (DRF), Django apps structure or migrations. Produces Django code with a service layer and N+1-free queries. Not for FastAPI (use python-fastapi-architecture).

45 stars 6 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add j4flmao/agent-skills --skill python-django-architecture
Manual install
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/skills/backend/python/django ~/.claude/skills/python-django-architecture

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Python Django Architecture

## Purpose
Structure Django applications with one app per bounded context, service layer for business logic, thin views, DRF serializers as DTOs, and clean separation of concerns.

## Agent Protocol

### Trigger
Exact user phrases: "Django structure", "Django architecture", "Django apps", "Django clean arch", "Django ORM", "Django REST framework", "DRF", "Django project layout".

### Input Context
Before activating, verify:
- requirements.txt or pyproject.toml has Django dependency.
- The app or feature being created is known.

### Output Artifact
No file output. Produces folder structure and code examples as text.

### Response Format
Folder structure:
```
config/
apps/{app}/
  models.py, services.py, repositories.py, serializers.py, views.py, urls.py
```

Code: module-level only. No import statements.

No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.

### Completion Criteria
- [ ] One Django app per bounded context (not per table or per view).
- [ ] Business logic in services.py, not in models.py or views.py.
- [ ] Models are thin (fields, basic constraints, string methods only).
- [ ] DRF serializers act as DTOs at the API boundary.
- [ ] Views are thin (validate input, call service, return response).
- [ ] Signals delegate to services, do not contain business logic.
- [ ] select_related/prefetch_related used to prevent N+1 queries.

### Max Response Length
Read the full skill on GitHub

Details

Skill name
python-django-architecture
Path
skills/backend/python/django/SKILL.md
License
MIT
Repo updated
17 November 2026

FAQ

What does the Python Django Architecture skill do?

Use when the user asks about Django, Django ORM queries that are slow, select_related and prefetch_related, Django REST framework (DRF), Django apps structure or migrations. Produces Django code with a service layer and N+1-free queries. Not for FastAPI (use python-fastapi-architecture).

How do I install the Python Django Architecture skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add j4flmao/agent-skills --skill python-django-architecture. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Python Django Architecture popular?

It lives in j4flmao/agent-skills, which has 45 GitHub stars and 6 forks.

Related skills

Agent Observability

45

j4flmao/agent-skills

Use when the user asks about agent observability, tracing agent reasoning, debugging an agent loop, OpenTelemetry GenAI spans for LLM calls, LLM cost tracking per agent, agent audit logs or hallucination/eval monitoring in production. Produces instrumentation config, trace schema, dashboards, alerts and cost attribution. Not for generic service tracing without LLMs (use devops-opentelemetry).

DevOps & Cloud

AI Agent Architectures

45

j4flmao/agent-skills

Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework (Claude Agent SDK, OpenAI Agents SDK, LangGraph). Produces an architecture brief covering loop, tools, memory, guardrails and evals, routing depth to child skills. Not for workflow patterns (use ai-agentic-workflows).

AI, LLMs & Agents

AI Agent Core Loop

45

j4flmao/agent-skills

Use when the user asks about the agent loop, ReAct vs plan-and-solve, re-planning, Reflexion, an agent stuck in a loop, max iterations or termination conditions. Produces a loop spec or patch with state, success predicate, caps and no-progress detection. Not for overall agent design (use ai-agent-architectures) or tool schemas (use tool-calling-principles).

AI, LLMs & Agents

Python Fastapi Architecture

45

j4flmao/agent-skills

Use when the user asks about FastAPI, setting up a FastAPI project with dependency injection and Pydantic models, Depends(), APIRouter structure, lifespan events or async SQLAlchemy. Produces a layered FastAPI project. Not for Django (use python-django-architecture) or Flask (use flask-backend).

Software Development

Ptx Assembly

45

j4flmao/agent-skills

Use when the user asks about PTX, inline asm volatile in CUDA, nvcc -ptx, ptxas -v register spills, state spaces, cp.async, mma.sync or bar.sync. Produces explained PTX listings or inline-asm snippets with constraints and SASS verification steps. Not for native machine code and stall analysis (use sass-machine-code) or kernel design (use cuda-programming).

Software Development

Quarkus Backend

45

j4flmao/agent-skills

Use when the user asks about Quarkus, Quarkus REST (RESTEasy Reactive), Panache, Dev Services, Quarkus native build, SmallRye Reactive Messaging or continuous testing. Produces Quarkus services with config, health checks and tests. Not for Micronaut (use micronaut) or Spring Boot (use spring-boot-architecture).

Software Development

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.