django-patterns

django-patterns is a skill for Claude Code, Codex from sjarmak/coding-agent-workflows. It costs 32 tokens per session (4,480 once invoked), scanned A, a copy of django-patterns, MIT.

Architecture and API guidance for Django, a Python web framework, including its database layer, REST APIs, caching, middleware, and project layout.

In plain words
What is it for?
Use it when structuring a Django project, designing REST endpoints, working with models, or adding caching, signals, and middleware.
Why use it?
It helps keep Django applications organized and avoids common design problems as they grow.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when structuring a Django project, designing REST endpoints, working with models, or adding caching, signals, and middleware.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/sjarmak/coding-agent-workflows/django-patterns/github.svg)](https://agentmods.dev/skills/sjarmak/coding-agent-workflows/django-patterns)
Your own site
<a href="https://agentmods.dev/skills/sjarmak/coding-agent-workflows/django-patterns"><img src="https://agentmods.dev/badge/skills/sjarmak/coding-agent-workflows/django-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for django-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/sjarmak/coding-agent-workflows/django-patterns"><img src="https://agentmods.dev/badge/skills/sjarmak/coding-agent-workflows/django-patterns.svg" alt="Reviewed on agentmods" width="80" 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 4,480 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.
Origin 86% copy Near-identical to another mod 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.04480
Opus 5.5 $0.00013 $0.01792
Sonnet 5.5 $0.00006 $0.00896
Haiku 4.5 $0.00003 $0.00448

Measured 1mo ago against content hash 52e606fcb25c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

Origin

This is a copy

86% identical to django-patterns — 32 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

optional/skills/django-patterns/SKILL.md · 740 lines

How it starts

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

Django Development Patterns

Use the project's installed version and conventions. Verify version-sensitive APIs, security settings, and deployment support with documentation-lookup before applying examples; these patterns are reference guidance, not a tested guarantee for every current release. Do not replace an existing toolchain solely to match an example.

Production-grade Django architecture patterns for scalable, maintainable applications.

When to Activate

  • Building Django web applications
  • Designing Django REST Framework APIs
  • Working with Django ORM and models
  • Setting up Django project structure
  • Implementing caching, signals, middleware

Project Structure

Recommended Layout

myproject/
├── config/
│   ├── __init__.py
│   ├── settings/
│   │   ├── __init__.py
│   │   ├── base.py          # Base settings
│   │   ├── development.py   # Dev settings
│   │   ├── production.py    # Production settings
│   │   └── test.py          # Test settings
│   ├── 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/
        └── ...

Split Settings Pattern

# 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
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 · 740 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. 1mo ago First seen · 740 lines · 32 tokens per session scan A 52e606fcb25c

Subscribe to this mod's changes

django-patterns is a skill published in the GitHub repository sjarmak/coding-agent-workflows (7 stars, last pushed 2d ago), licensed MIT. It adds 32 tokens to every session and 4,480 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 86% identical to django-patterns, differing in 32 lines, and is treated as a copy.

Related

django-patterns compared with skills from other repositories

django-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
django-patternssjarmak/coding-agent-workflowsSkill72d agoMITA32Claude Code, Codex
upgrade-nestjsPhaedra-Solutions/cursor-rulesSkill428d agoMITA119Claude Code, Codex
upgrade-supabasePhaedra-Solutions/cursor-rulesSkill428d agoMITA121Claude Code, Codex
migrate-dotnet-frameworkPhaedra-Solutions/cursor-rulesSkill428d agoMITA138Claude Code, Codex
migrate-strutsPhaedra-Solutions/cursor-rulesSkill428d agoMITA120Claude Code, Codex
upgrade-djangoPhaedra-Solutions/cursor-rulesSkill428d agoMITA132Claude Code, Codex
upgrade-expressPhaedra-Solutions/cursor-rulesSkill428d agoMITA113Claude Code, Codex