django-api

django-api is a skill for Claude Code from jpoutrin/product-forge. It costs 58 tokens per session (2,364 once invoked), scanned A, original, MIT.

A guide to building APIs in Django using Django Ninja or Django REST Framework, tools for exposing application data and actions through web endpoints.

In plain words
What is it for?
Use it to create Django REST APIs, define typed request and response schemas, add access control, filter results, paginate data, and generate API documentation.
Why use it?
It helps choose an API approach and implement authentication, permissions, filtering, pagination, validation, and asynchronous endpoints.

Skill for Claude Code

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

Part of the python-experts plugin — 11 skills, 5 agents shipped together

Good fit Use it to create Django REST APIs, define typed request and response schemas, add access control, filter results, paginate data, and generate API documentation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jpoutrin/product-forge/django-api
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 jpoutrin/product-forge --skill django-api
Clone the repo
git clone --depth 1 https://github.com/jpoutrin/product-forge

Made for: Claude Code.

Or install python-experts, the plugin that ships this one along with the rest of its 11 skills, 5 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-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/jpoutrin/product-forge/django-api/github.svg)](https://agentmods.dev/skills/jpoutrin/product-forge/django-api)
Your own site
<a href="https://agentmods.dev/skills/jpoutrin/product-forge/django-api"><img src="https://agentmods.dev/badge/skills/jpoutrin/product-forge/django-api/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-api

Your own site · 80×15
<a href="https://agentmods.dev/skills/jpoutrin/product-forge/django-api"><img src="https://agentmods.dev/badge/skills/jpoutrin/product-forge/django-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,364 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.00058 $0.02364
Opus 5.5 $0.00023 $0.00946
Sonnet 5.5 $0.00012 $0.00473
Haiku 4.5 $0.00006 $0.00236

Measured 3mo ago against content hash 46353c0b5cb9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

django-api 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.

plugins/python-experts/skills/django-api/SKILL.md · 422 lines

How it starts

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

Django API Development (2025)

Framework Choice

Factor Django Ninja Django REST Framework
Best for New projects, performance-critical, type-safety Complex apps, mature ecosystem needs
Validation Pydantic (type hints) Serializers
Async Native, first-class Via adrf package
Docs Auto-generated OpenAPI Via drf-spectacular
Learning curve Lower (FastAPI-like) Steeper but well-documented
Ecosystem Growing Extensive third-party packages

Recommendation: Start with Django Ninja for new projects. Use DRF when you need its ecosystem (complex permissions, nested routers, etc).


Setup

pip install django-ninja
# config/urls.py
from ninja import NinjaAPI

api = NinjaAPI(
    title="My API",
    version="1.0.0",
    docs_url="/docs",  # Swagger UI at /api/docs
)

urlpatterns = [
    path("admin/", admin.site.urls),
    path("api/", api.urls),
]

Schemas (Pydantic)

# apps/blog/api/schemas.py
from ninja import Schema, ModelSchema
from datetime import datetime
from apps.blog.models import Article


class ArticleIn(Schema):
    title: str
    body: str
    tag_ids: list[int] = []


class ArticleOut(ModelSchema):
    author_name: str

    class Meta:
        model = Article
        fields = ["id", "title", "slug", "status", "created_at"]

    @staticmethod
    def resolve_author_name(obj: Article) -> str:
        return obj.author.username


class ArticleDetailOut(ArticleOut):
    body: str
    tags: list[str]

    @staticmethod
    def resolve_tags(obj: Article) -> list[str]:
        return [t.name for t in obj.tags.all()]

Key patterns:

  • Use Schema for input, ModelSchema for output
  • Type hints drive validation and docs
  • Use resolve_* for computed fields

Endpoints

# apps/blog/api/views.py
from ninja import Router
from django.shortcuts import get_object_or_404
from apps.blog.models import Article
from .schemas import ArticleIn, ArticleOut, ArticleDetailOut

router = Router(tags=["articles"])


@router.get("/", response=list[ArticleOut])
def list_articles(request, status: str | None = None):
    qs = Article.objects.select_related("author")
    if status:
        qs = qs.filter(status=status)
    return qs


@router.get("/{slug}", response=ArticleDetailOut)
def get_article(request, slug: str):
    return get_object_or_404(
        Article.objects.select_related("author").prefetch_related("tags"),
        slug=slug,
    )


@router.post("/", response=ArticleOut)
def create_article(request, payload: ArticleIn):
    article = Article.objects.create(
        author=request.user,
        title=payload.title,
        body=payload.body,
    )
    if payload.tag_ids:
        article.tags.set(payload.tag_ids)
    return article

Read the full file on GitHub · 422 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 · 422 lines · 58 tokens per session scan A 46353c0b5cb9

Subscribe to this mod's changes

django-api is a skill published in the GitHub repository jpoutrin/product-forge (16 stars, last pushed 9mo ago), licensed MIT. It adds 58 tokens to every session and 2,364 once invoked, about $0.0002 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-api compared with skills from other repositories

django-api next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
django-apijpoutrin/product-forgeSkill169mo agoMITA58Claude Code
fastapi-patternsaffaan-m/ECCSkill317k3d agoMITA35Claude Code, Kiro
stripe-projectse2b-dev/E2BSkill15ktodayApache-2.0A51Claude Code, Codex
azure-mgmt-botservice-pymicrosoft/skillsSkill3.3ktodayMITA59Claude Code
azure-messaging-webpubsubservice-pymicrosoft/skillsSkill3.3ktodayMITA64Claude Code
azure-appconfiguration-pybenjaminasterA/antigravity-awesome-skillsSkill528todayMITA0Claude Code, Codex
azure-messaging-webpubsubservice-pybenjaminasterA/antigravity-awesome-skillsSkill528todayMITA0Claude Code, Codex