python-django-architecture

python-django-architecture is a skill for Claude Code, Codex from j4flmao/agent-skills. It costs 126 tokens per session (5,374 once invoked), scanned A, original, MIT.

A set of rules for organizing Django web applications, a Python framework for building websites and web APIs. It separates business rules, database models, request handling, and API data formats into clear parts.

In plain words
What is it for?
Use it when creating Django projects, choosing app boundaries, designing database access with Django's ORM, or building APIs with Django REST Framework (DRF).
Why use it?
It reduces the risk of putting too much logic in views or database models, making the code harder to test and change.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex.

Good fit Use it when creating Django projects, choosing app boundaries, designing database access with Django's ORM, or building APIs with Django REST Framework (DRF).

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/j4flmao/agent-skills/django
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add j4flmao/agent-skills --skill django
Clone the repo
git clone --depth 1 https://github.com/j4flmao/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for python-django-architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/j4flmao/agent-skills/django.svg)](https://agentmods.dev/skills/j4flmao/agent-skills/django)
Your own site
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/django"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/django.svg" alt="Measured on agentmods" height="20"></a>
Per session 126 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,374 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00126 $0.05374
Opus 5 $0.00063 $0.02687
Sonnet 5 $0.00025 $0.01075
Haiku 4.5 $0.00013 $0.00537

Measured 8d ago against content hash 0a787062cfc3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

python-django-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/backend/python/django/SKILL.md · 637 lines

How it starts

The opening of the file, as written. The whole thing — 637 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

Folder structure: unlimited. Code: 15 lines per example.

Architecture Decision Trees

Django App Boundaries: Bounded Context vs Table-per-app

Criterion Bounded Context (Recommended) Table-per-app
Coupling Loose (context boundary) Tight (related tables split)
Team autonomy High (per context ownership) Low (changes affect multiple apps)
Reusability High (complete business capability) Low (fragmented)
Migration complexity Low (within context) High (cross-app foreign keys)

Read the full file on GitHub · 637 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 637 lines · 126 tokens per session scan A 0a787062cfc3

Subscribe to this mod's changes

python-django-architecture is a skill published in the GitHub repository j4flmao/agent-skills (22 stars, last pushed yesterday), licensed MIT. It adds 126 tokens to every session and 5,374 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

django

Use when building, reviewing, securing, testing or shipping a Django app — models, migrations, QuerySets/managers, FBV/CBV views, forms, the admin, settings split, and Django REST Framework (serializers, ModelViewSet, permissions). NOT async FastAPI/Pydantic services (that is fastapi), NOT Postgres schema/index work…

ericrisco/rsc-harness · 84 tokens

django-expert

Expert-level Django development for robust Python web applications with ORM, admin, and authentication. Use when the user mentions Python, web, ORM, MVC, or Django REST Framework, or when the task involves Django Architecture.

personamanagmentlayer/pcl · 47 tokens

django-seedkit

Bootstrap a new Django project, or add components — auth (allauth, magic-link, axes, 2FA), payments (Stripe, dj-stripe), REST (django-modern-rest, django-bolt), Celery / Django Tasks, async views & WebSockets (ASGI, uvicorn worker, django-channels, channels-redis), Tailwind+DaisyUI, favicon, SEO meta tags + sitemap…

viewflow/seedkit · 172 tokens

django-celery-expert

Expert Django Celery guidance for asynchronous task processing. Use when designing background tasks, configuring Celery workers, handling task retries and errors, optimizing Celery performance, implementing periodic tasks with Celery Beat, or setting up production monitoring for Celery. Do not use for general Django…

wilfredinni/django-starter-template · 115 tokens

django-expert

Expert Django backend development guidance. Use when creating Django models, views, serializers, or APIs; debugging ORM queries or migrations; optimizing database performance; implementing authentication; writing tests; or working with Django REST Framework. Follows Django best practices and modern patterns.

wilfredinni/django-starter-template · 55 tokens

django-6-upgrade-guide

Plan, audit, or complete an upgrade from Django 5.x to Django 6. Verify runtime and dependency compatibility, deprecations, settings, databases, migrations, tests, and deployment. Do not use for general Django work, earlier upgrades, frontend styles, or unrelated maintenance.

btfranklin/skills · 64 tokens