django-patterns

django-patterns is a skill for Claude Code, Codex from Global-mindee/WAY. It costs 22 tokens per session (918 once invoked), scanned A, original, MIT.

A guide to structuring Django applications, web applications built with the Python Django framework. It covers Django REST Framework, database queries, signals, middleware, project structure, and testing.

In plain words
What is it for?
Use it to organize Django apps, build APIs, optimize ORM queries, separate reads from writes, add middleware or signals, and write tests.
Why use it?
It helps keep business logic organized and makes database access more efficient as a Django project grows.

Skill for Claude CodeCodex

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

Good fit Use it to organize Django apps, build APIs, optimize ORM queries, separate reads from writes, add middleware or signals, and write tests.

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

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/global-mindee/way/django-patterns/github.svg)](https://agentmods.dev/skills/global-mindee/way/django-patterns)
Your own site
<a href="https://agentmods.dev/skills/global-mindee/way/django-patterns"><img src="https://agentmods.dev/badge/skills/global-mindee/way/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/global-mindee/way/django-patterns"><img src="https://agentmods.dev/badge/skills/global-mindee/way/django-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 918 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 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.00022 $0.00918
Opus 5.5 $0.00009 $0.00367
Sonnet 5.5 $0.00004 $0.00184
Haiku 4.5 $0.00002 $0.00092

Measured 3mo ago against content hash 80fea6d8313a, 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 3mo 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/04_infra-platform/django-patterns/SKILL.md · 141 lines

How it starts

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

Django Patterns

Project Structure

Organize Django projects with a clear separation between apps, shared utilities, and configuration.

project/
  config/
    settings/
      base.py
      local.py
      production.py
    urls.py
    wsgi.py
  apps/
    users/
      models.py
      serializers.py
      views.py
      services.py
      selectors.py
      urls.py
      tests/
    orders/
      ...
  common/
    models.py
    permissions.py
    pagination.py

Keep business logic in services.py (write operations) and selectors.py (read operations). Views should remain thin.

ORM Optimization

# select_related for ForeignKey / OneToOne (SQL JOIN)
orders = Order.objects.select_related("customer", "customer__profile").all()

# prefetch_related for ManyToMany / reverse FK (separate query)
authors = Author.objects.prefetch_related(
    Prefetch("books", queryset=Book.objects.filter(published=True))
).all()

# Defer fields you don't need
posts = Post.objects.defer("body", "metadata").filter(status="published")

# Use .only() when you need just a few columns
emails = User.objects.only("id", "email").filter(is_active=True)

# Bulk operations
Product.objects.bulk_create(products, batch_size=1000)
Product.objects.bulk_update(products, ["price", "stock"], batch_size=1000)

Always check queries with django-debug-toolbar or connection.queries in tests.

Django REST Framework Serializers

class OrderSerializer(serializers.ModelSerializer):
    customer_name = serializers.CharField(source="customer.full_name", read_only=True)
    items = OrderItemSerializer(many=True, read_only=True)
    total = serializers.SerializerMethodField()

    class Meta:
        model = Order
        fields = ["id", "customer_name", "items", "total", "created_at"]
        read_only_fields = ["id", "created_at"]

    def get_total(self, obj):
        return sum(item.price * item.quantity for item in obj.items.all())

    def validate(self, data):
        if data.get("start_date") and data.get("end_date"):
            if data["start_date"] >= data["end_date"]:
                raise serializers.ValidationError("end_date must be after start_date")
        return data

Read the full file on GitHub · 141 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. 3mo ago First seen · 141 lines · 22 tokens per session scan A 80fea6d8313a

Subscribe to this mod's changes

django-patterns is a skill published in the GitHub repository Global-mindee/WAY (11 stars, last pushed 2mo ago), licensed MIT. It adds 22 tokens to every session and 918 once invoked, about $0.0001 per session on Opus 5.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.

Related

django-patterns compared with skills from other repositories

django-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
django-patternsGlobal-mindee/WAYSkill112mo agoMITA22Claude Code, Codex
fastapi-patternsaffaan-m/ECCSkill315kyesterdayMITA35Claude Code, Kiro
stripe-projectse2b-dev/E2BSkill15ktodayApache-2.0A51Claude Code, Codex
azure-messaging-webpubsubservice-pymicrosoft/skillsSkill3.3ktodayMITA64Claude Code
azure-appconfiguration-pybenjaminasterA/antigravity-awesome-skillsSkill526yesterdayMITA0Claude Code, Codex
azure-messaging-webpubsubservice-pybenjaminasterA/antigravity-awesome-skillsSkill526yesterdayMITA0Claude Code, Codex
x-thread-readertokenbender/agent-guidesSkill36912d agoApache-2.0A54Claude Code, Codex