drf

A set of conventions for building web APIs with Django REST Framework, a Python toolkit for creating REST services. It adds choices for login tokens, permissions, filtering, search, sorting, pagination, rate limits, and OpenAPI documentation.

In plain words
What is it for?
Use it when adding Django REST Framework to a Django project, configuring JWT login, protected endpoints, filters, pagination, throttling, or generated API documentation.
Why use it?
It gives a Django project consistent API settings and security defaults. It also defines common libraries and response-handling patterns for the API layer.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/rishapgandhi/python-skills/drf
Any agent
npx skills add rishapgandhi/python-skills --skill drf
Clone the repo
git clone --depth 1 https://github.com/rishapgandhi/python-skills

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,361 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.03361
Opus 5 $0.00000 $0.01681
Sonnet 5 $0.00000 $0.00672
Haiku 4.5 $0.00000 $0.00336

Measured 2d ago against content hash 6f35df8c9602, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

drf 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 2d 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/drf/SKILL.md · 537 lines

How it starts

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

Django REST Framework (DRF) Skill

Load alongside skills/django/SKILL.md and all skills/common/ files.


Stack Additions (on top of Django)

Layer Library
REST Framework djangorestframework 3.15+
JWT Auth djangorestframework-simplejwt
Filtering django-filter
Throttling DRF built-in
Schema / Docs drf-spectacular (OpenAPI 3)
Pagination DRF built-in + custom

Settings

# config/settings/base.py
REST_FRAMEWORK = {
    "DEFAULT_AUTHENTICATION_CLASSES": [
        "rest_framework_simplejwt.authentication.JWTAuthentication",
    ],
    "DEFAULT_PERMISSION_CLASSES": [
        "rest_framework.permissions.IsAuthenticated",
    ],
    "DEFAULT_RENDERER_CLASSES": [
        "rest_framework.renderers.JSONRenderer",
    ],
    "DEFAULT_PAGINATION_CLASS": "apps.core.pagination.StandardResultsPagination",
    "PAGE_SIZE": 20,
    "DEFAULT_FILTER_BACKENDS": [
        "django_filters.rest_framework.DjangoFilterBackend",
        "rest_framework.filters.SearchFilter",
        "rest_framework.filters.OrderingFilter",
    ],
    "DEFAULT_THROTTLE_CLASSES": [
        "rest_framework.throttling.AnonRateThrottle",
        "rest_framework.throttling.UserRateThrottle",
    ],
    "DEFAULT_THROTTLE_RATES": {
        "anon": "100/day",
        "user": "1000/day",
    },
    "EXCEPTION_HANDLER": "apps.core.exception_handler.custom_exception_handler",
}

Serializer Standards

# apps/users/serializers.py
from rest_framework import serializers
from apps.users.models import User

class UserCreateSerializer(serializers.ModelSerializer):
    """Serializer for creating a new user account."""

    password = serializers.CharField(write_only=True, min_length=8)

    class Meta:
        model = User
        fields = ["email", "name", "password"]
        extra_kwargs = {"password": {"write_only": True}}

    def validate_email(self, value: str) -> str:
        if User.objects.filter(email=value.lower()).exists():
            raise serializers.ValidationError("Email already in use.")
        return value.lower()

    def create(self, validated_data: dict) -> User:
        from apps.users.services import UserService
        return UserService.create_user(**validated_data)


class UserResponseSerializer(serializers.ModelSerializer):
    """Read-only serializer for user responses."""

    class Meta:
        model = User
        fields = ["id", "public_id", "email", "name", "is_active", "created_at"]
        read_only_fields = fields

Read the full file on GitHub · 537 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. 2d ago First seen · 537 lines · 0 tokens per session scan A 6f35df8c9602

Subscribe to this mod's changes

drf is a skill published in the GitHub repository rishapgandhi/python-skills (4 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,361 tokens. 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-31.

Related

Other skills, from other repositories

python-expert

Use for Python code changes, FastAPI/Django/Flask services, packaging, typing, async, pytest, data scripts, dependency hygiene, or Python performance fixes.

DominikTobureto/awesome-grok-build · 38 tokens

roam

Codebase comprehension via roam-code CLI. Use when exploring codebases, planning modifications, debugging failures, assessing PR risk, or checking architecture health. Triggers on: understanding project structure, pre-change safety checks, finding symbols/files, blast radius analysis, affected tests, health scoring…

Cranot/roam-code · 86 tokens

ring:searching-code

Forensic code search and analysis with optional Chain of Draft (CoD) ultra-concise mode. Five-phase methodology (clarification, planning, execution, analysis, synthesis) with severity assessment. Use for targeted investigation of specific patterns, bugs, or vulnerabilities. Skip for broad architecture mapping (use…

LerianStudio/ring · 74 tokens

ring:exploring-codebases

Exploring a codebase across phases: scopes the target, detects architecture, components, and layers, deep-dives each discovered perspective, then synthesizes findings into actionable guidance with file:line evidence. Use to understand how a feature or system works before planning changes, or to orient on an unfamiliar…

LerianStudio/ring · 91 tokens

ring:generating-release-guides

Generating an internal Operations-facing update/migration guide from the git diff between two refs, documenting per-change client impact, deploy ordering, monitoring, and rollback notes in English, pt-br, or both. Use when preparing a version release or recording what changed for the Ops team. Runs read-only by…

LerianStudio/ring · 85 tokens

ring:writing-skills

Writing or editing a Ring skill: SKILL.md structure, frontmatter and Agent-Search-Optimization rules, token-efficiency targets, and bulletproofing (Iron Law, rationalization tables, Red Flags) so discipline-enforcing skills resist excuses. Use when creating or revising a skill. Delegates pressure-testing to…

LerianStudio/ring · 100 tokens