Django REST Framework patterns. An agent skill from Gentleman-Programming/Gentleman-Skills.

Apache-2.0Auto-check passedBackend & APIs

Install Django Drf

skills CLI
$ npx skills add Gentleman-Programming/Gentleman-Skills --skill django-drf -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Gentleman-Programming/Gentleman-Skills django-drf --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Gentleman-Programming/Gentleman-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/curated/django-drf .claude/skills/django-drf && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
django-drf
GitHub stars
657
Token cost
~1.2k tokens
SKILL.md length
21 words
Files
1
Skills in repo
23
Repo updated
First seen
Licence
Apache-2.0

At a glance

Django REST Framework patterns. An agent skill from Gentleman-Programming/Gentleman-Skills.

  • Tasks that involve Backend development
  • SKILL.md covers ViewSet Pattern, Serializer Patterns, Filters and Permissions, plus 5 more sections
  • Calls python
  • Tasks that involve REST APIs

What it does

Django Drf is an agent skill from Gentleman-Programming/Gentleman-Skills. Django REST Framework patterns. Trigger: When building REST APIs with Django - ViewSets, Serializers, Filters.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Backend development and REST APIs. It works with Django. The repository describes itself as: Community-driven AI agent skills for Claude Code, OpenCode, and other AI assistants. Curated patterns and community contributions. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Backend development
  • Tasks that involve REST APIs

Example prompts

  • “/django-drf”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit c8036a3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Django Drf loads about 1.2k tokens when it runs. Until then it costs about 30 tokens; SKILL.md has 21 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~30
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Gentleman-Programming/Gentleman-Skills at commit c8036a3, republished under its Apache-2.0 licence (© Gentleman-Programming). 21 words, ~1,159 tokens.

Download SKILL.mdSave it as .claude/skills/django-drf/SKILL.md (or your agent's skills folder).
name
django-drf
description
Django REST Framework patterns. Trigger: When building REST APIs with Django - ViewSets, Serializers, Filters.
license
Apache-2.0
metadata.author
gentleman-programming
metadata.version
1.0

ViewSet Pattern

python
from rest_framework import viewsets, status
from rest_framework.response import Response
from rest_framework.decorators import action

class UserViewSet(viewsets.ModelViewSet):
    queryset = User.objects.all()
    serializer_class = UserSerializer
    filterset_class = UserFilter
    permission_classes = [IsAuthenticated]

    def get_serializer_class(self):
        if self.action == "create":
            return UserCreateSerializer
        if self.action in ["update", "partial_update"]:
            return UserUpdateSerializer
        return UserSerializer

    @action(detail=True, methods=["post"])
    def activate(self, request, pk=None):
        user = self.get_object()
        user.is_active = True
        user.save()
        return Response({"status": "activated"})

Serializer Patterns

python
from rest_framework import serializers

# Read Serializer
class UserSerializer(serializers.ModelSerializer):
    full_name = serializers.SerializerMethodField()

    class Meta:
        model = User
        fields = ["id", "email", "full_name", "created_at"]
        read_only_fields = ["id", "created_at"]

    def get_full_name(self, obj):
        return f"{obj.first_name} {obj.last_name}"

# Create Serializer
class UserCreateSerializer(serializers.ModelSerializer):
    password = serializers.CharField(write_only=True)

    class Meta:
        model = User
        fields = ["email", "password", "first_name", "last_name"]

    def create(self, validated_data):
        password = validated_data.pop("password")
        user = User(**validated_data)
        user.set_password(password)
        user.save()
        return user

# Update Serializer
class UserUpdateSerializer(serializers.ModelSerializer):
    class Meta:
        model = User
        fields = ["first_name", "last_name"]

Filters

python
from django_filters import rest_framework as filters

class UserFilter(filters.FilterSet):
    email = filters.CharFilter(lookup_expr="icontains")
    is_active = filters.BooleanFilter()
    created_after = filters.DateTimeFilter(
        field_name="created_at",
        lookup_expr="gte"
    )
    created_before = filters.DateTimeFilter(
        field_name="created_at",
        lookup_expr="lte"
    )

    class Meta:
        model = User
        fields = ["email", "is_active"]

Permissions

python
from rest_framework.permissions import BasePermission

class IsOwner(BasePermission):
    def has_object_permission(self, request, view, obj):
        return obj.owner == request.user

class IsAdminOrReadOnly(BasePermission):
    def has_permission(self, request, view):
        if request.method in ["GET", "HEAD", "OPTIONS"]:
            return True
        return request.user.is_staff

Pagination

python
from rest_framework.pagination import PageNumberPagination

class StandardPagination(PageNumberPagination):
    page_size = 20
    page_size_query_param = "page_size"
    max_page_size = 100

# settings.py
REST_FRAMEWORK = {
    "DEFAULT_PAGINATION_CLASS": "api.pagination.StandardPagination",
}

URL Routing

python
from rest_framework.routers import DefaultRouter

router = DefaultRouter()
router.register(r"users", UserViewSet, basename="user")
router.register(r"posts", PostViewSet, basename="post")

urlpatterns = [
    path("api/v1/", include(router.urls)),
]

Testing

python
import pytest
from rest_framework import status
from rest_framework.test import APIClient

@pytest.fixture
def api_client():
    return APIClient()

@pytest.fixture
def authenticated_client(api_client, user):
    api_client.force_authenticate(user=user)
    return api_client

@pytest.mark.django_db
class TestUserViewSet:
    def test_list_users(self, authenticated_client):
        response = authenticated_client.get("/api/v1/users/")
        assert response.status_code == status.HTTP_200_OK

    def test_create_user(self, authenticated_client):
        data = {"email": "new@test.com", "password": "pass123"}
        response = authenticated_client.post("/api/v1/users/", data)
        assert response.status_code == status.HTTP_201_CREATED

Commands

bash
python manage.py runserver
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py shell

Keywords

django, drf, rest framework, viewset, serializer, api, rest api

© Gentleman-Programming, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in curated/django-drf of Gentleman-Programming/Gentleman-Skills.

Open the folder on GitHubat commit c8036a3

Compare with similar skills

Django Drf next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Django Drf compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Django Drf this skillGentleman-Programming/Gentleman-Skills657—~1.2kAutomated safety check: PassApache-2.0
Django ExpertJeffallan/claude-skills12k—~1.5kAutomated safety check: PassMIT
Django Create API Endpointfossasia/eventyay1.7k—~239Automated safety check: PassApache-2.0
Implementing MCP ToolsPostHog/posthog-foss721—~3.7kAutomated safety check: PassMIT
Bruno APIaiskillstore/marketplace4301 repos~1.5kAutomated safety check: NotesNone
Profiling Slow API EndpointsPostHog/posthog-foss721—~1kAutomated safety check: PassMIT

Similar skills

  • Django Expert

    Jeffallan/claude-skills

    Builds Django apps and Django REST Framework APIs: models with indexes, ORM query optimization, serializers, viewsets and JWT authentication, with tests.

    12k GitHub stars~1.5k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • Steps for adding a new Django REST Framework API endpoint. An agent skill from fossasia/eventyay.

    1.7k GitHub stars~239 tokensUpdated today
    Backend & APIsAuto-check passed
  • Implementing MCP Tools

    PostHog/posthog-foss

    Official

    Guide for exposing PostHog product endpoints as MCP tools. An agent skill from PostHog/posthog-foss.

    721 GitHub stars~3.7k tokensUpdated today
    Backend & APIsAuto-check passed
  • Bruno API

    aiskillstore/marketplace

    Generate comprehensive API endpoint documentation from Bruno (.bru) files by mapping requests to a Django4Lyfe/Diversio-style backend implementation (Django REST Framework or Django Ninja)…

    430 GitHub starsUsed in 1 repo~1.5k tokens
    Backend & APIsAuto-check: notes
  • Profiling Slow API Endpoints

    PostHog/posthog-foss

    Official

    Profiles slow PostHog API endpoints when the main cost is in Postgres or Python.

    721 GitHub stars~1k tokensUpdated today
    DatabasesAuto-check passed
  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    158 GitHub starsUsed in 17 repos~4k tokens
    Backend & APIsAuto-check passed

More from Gentleman-Programming/Gentleman-Skills

All 23 skills in this repo
  • Elixir Antipatterns

    Gentleman-Programming/Gentleman-Skills

    Core catalog of 8 critical Elixir/Phoenix anti-patterns covering error handling, separation of concerns, Ecto queries, and testing.

    657 GitHub stars~2.1k tokensUpdated 6 mo ago
    Auto-check passed
  • Skill Creator

    Gentleman-Programming/Gentleman-Skills

    Creates new AI agent skills following the Agent Skills spec.

    657 GitHub stars~1.1k tokensUpdated 6 mo ago
    Auto-check: notes
  • Angular Architecture

    Gentleman-Programming/Gentleman-Skills

    Angular architecture: Scope Rule, project structure, file naming, style guide.

    657 GitHub stars~823 tokensUpdated 6 mo ago
    Auto-check passed
  • Angular Core

    Gentleman-Programming/Gentleman-Skills

    Angular core patterns: standalone components, signals, inject, control flow, zoneless.

    657 GitHub stars~1.1k tokensUpdated 6 mo ago
    Auto-check passed
  • Angular Forms

    Gentleman-Programming/Gentleman-Skills

    Angular forms: Signal Forms (experimental) and Reactive Forms.

    657 GitHub stars~687 tokensUpdated 6 mo ago
    Auto-check passed
  • Angular Performance

    Gentleman-Programming/Gentleman-Skills

    Angular performance: NgOptimizedImage, @defer, lazy loading, SSR.

    657 GitHub stars~703 tokensUpdated 6 mo ago
    Auto-check passed

Works with

Categories

Questions about Django Drf

What does Django Drf do?

Django REST Framework patterns. An agent skill from Gentleman-Programming/Gentleman-Skills. Django Drf is an agent skill from Gentleman-Programming/Gentleman-Skills. Django REST Framework patterns.

When should I use Django Drf?

Django Drf fits situations like: tasks that involve Backend development; tasks that involve REST APIs.

How do I install Django Drf in Claude Code?

Run `npx skills add Gentleman-Programming/Gentleman-Skills --skill django-drf -a claude-code`. Or copy the skill folder (curated/django-drf in Gentleman-Programming/Gentleman-Skills) into .claude/skills/django-drf in your project. Claude Code loads it when a task matches its description.

How do I install Django Drf in Codex?

Run `npx skills add Gentleman-Programming/Gentleman-Skills --skill django-drf -a codex`. Or copy the skill folder (curated/django-drf in Gentleman-Programming/Gentleman-Skills) into .agents/skills/django-drf in your project. Codex loads it when a task matches its description.

Can I use Django Drf in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Gentleman-Programming/Gentleman-Skills --skill django-drf -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/django-drf, .gemini/skills/django-drf, .github/skills/django-drf and .opencode/skills/django-drf in your project.

What does Django Drf need to run?

Going by SKILL.md and its folder, Django Drf needs the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Django Drf access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Django Drf safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Django Drf use?

Django Drf is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Django Drf use?

About 1.2k tokens (SKILL.md is roughly 4.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Django Drf?

Skills that share tags, products or a category with Django Drf: Django Expert (Jeffallan/claude-skills, 12k stars), Django Create API Endpoint (fossasia/eventyay, 1.7k stars), Implementing MCP Tools (PostHog/posthog-foss, 721 stars) and Bruno API (aiskillstore/marketplace, 430 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Django Drf?

Gentleman-Programming (a GitHub organization) maintains it in Gentleman-Programming/Gentleman-Skills, which has 657 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on March 28, 2026.

Source: Gentleman-Programming/Gentleman-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.