django-patterns

django-patterns is a skill for Claude Code from loulanyue/awesome-claude-notes. It costs 32 tokens per session (5,123 once invoked), scanned A, original, MIT.

A set of Django architecture and development patterns for web applications and REST APIs. It covers project structure, database models, caching, signals, middleware, and production configuration.

In plain words
What is it for?
Use it to structure Django projects, design Django REST Framework APIs, work with models, and add caching, signals, or middleware.
Why use it?
It gives developers consistent ways to organize Django code as an application grows. Django’s ORM is the layer that lets code work with database records through Python models.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the awesome-claude-notes plugin — 106 skills, 61 commands, 28 agents shipped together

Good fit Use it to structure Django projects, design Django REST Framework APIs, work with models, and add caching, signals, or middleware.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/loulanyue/awesome-claude-notes/django-patterns
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 loulanyue/awesome-claude-notes --skill django-patterns
Clone the repo
git clone --depth 1 https://github.com/loulanyue/awesome-claude-notes

Made for: Claude Code.

Or install awesome-claude-notes, the plugin that ships this one along with the rest of its 106 skills, 61 commands, 28 agents.

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 django-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/loulanyue/awesome-claude-notes/django-patterns.svg)](https://agentmods.dev/skills/loulanyue/awesome-claude-notes/django-patterns)
Your own site
<a href="https://agentmods.dev/skills/loulanyue/awesome-claude-notes/django-patterns"><img src="https://agentmods.dev/badge/skills/loulanyue/awesome-claude-notes/django-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,123 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 warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Agent Snooping · line 4
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
  • medium Agent Snooping · line 737
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
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.00032 $0.05123
Opus 5 $0.00016 $0.02561
Sonnet 5 $0.00006 $0.01025
Haiku 4.5 $0.00003 $0.00512

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

Security

Grade A, and why

django-patterns 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 4d 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.

docs/ja-JP/skills/django-patterns/SKILL.md · 743 lines

How it starts

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

Django 開発パターン

スケーラブルで保守可能なアプリケーションのための本番グレードのDjangoアーキテクチャパターン。

いつ有効化するか

  • Djangoウェブアプリケーションを構築するとき
  • Django REST Framework APIを設計するとき
  • Django ORMとモデルを扱うとき
  • Djangoプロジェクト構造を設定するとき
  • キャッシング、シグナル、ミドルウェアを実装するとき

プロジェクト構造

推奨レイアウト

myproject/
├── config/
│   ├── __init__.py
│   ├── settings/
│   │   ├── __init__.py
│   │   ├── base.py          # 基本設定
│   │   ├── development.py   # 開発設定
│   │   ├── production.py    # 本番設定
│   │   └── test.py          # テスト設定
│   ├── urls.py
│   ├── wsgi.py
│   └── asgi.py
├── manage.py
└── apps/
    ├── __init__.py
    ├── users/
    │   ├── __init__.py
    │   ├── models.py
    │   ├── views.py
    │   ├── serializers.py
    │   ├── urls.py
    │   ├── permissions.py
    │   ├── filters.py
    │   ├── services.py
    │   └── tests/
    └── products/
        └── ...

分割設定パターン

# config/settings/base.py
from pathlib import Path

BASE_DIR = Path(__file__).resolve().parent.parent.parent

SECRET_KEY = env('DJANGO_SECRET_KEY')
DEBUG = False
ALLOWED_HOSTS = []

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'rest_framework',
    'rest_framework.authtoken',
    'corsheaders',
    # Local apps
    'apps.users',
    'apps.products',
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'whitenoise.middleware.WhiteNoiseMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'corsheaders.middleware.CorsMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'config.urls'
WSGI_APPLICATION = 'config.wsgi.application'

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': env('DB_NAME'),
        'USER': env('DB_USER'),
        'PASSWORD': env('DB_PASSWORD'),
        'HOST': env('DB_HOST'),
        'PORT': env('DB_PORT', default='5432'),
    }
}

# config/settings/development.py
from .base import *

DEBUG = True
ALLOWED_HOSTS = ['localhost', '127.0.0.1']

DATABASES['default']['NAME'] = 'myproject_dev'

INSTALLED_APPS += ['debug_toolbar']

MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware']

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

# config/settings/production.py
from .base import *

DEBUG = False
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS')
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_HSTS_SECONDS = 31536000
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SECURE_HSTS_PRELOAD = True

# ロギング
LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'file': {
            'level': 'WARNING',
            'class': 'logging.FileHandler',
            'filename': '/var/log/django/django.log',
        },
    },
    'loggers': {
        'django': {
            'handlers': ['file'],
            'level': 'WARNING',
            'propagate': True,
        },
    },
}

Read the full file on GitHub · 743 lines

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. 4d ago First seen · 743 lines · 32 tokens per session scan A bdd541a3abc1

Subscribe to this mod's changes

django-patterns is a skill published in the GitHub repository loulanyue/awesome-claude-notes (270 stars, last pushed 4d ago), licensed MIT. It adds 32 tokens to every session and 5,123 once invoked, about $0.0002 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-09-03.