django-drf

Define reusable Django REST Framework patterns for ViewSets, serializers, filters, and permissions.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/himuraxkenji/dotfiles-nix --skill django-drf-himuraxkenji
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: django-drf
Source: https://github.com/himuraxkenji/dotfiles-nix/tree/main/claude/skills/django-drf
Command: npx skills add https://github.com/himuraxkenji/dotfiles-nix --skill django-drf-himuraxkenji

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Defines reusable patterns for building DRF APIs.

Core Features & Use Cases

  • ViewSet Pattern: Examples of ViewSet usage including ModelViewSet with dynamic serializer selection, action-based endpoints, and basic authentication and permissions.
  • Serializer Patterns: Read and write serializers for User-like models, including password handling and nested representations.
  • Filters: Integration with django-filter to enable filtering by fields such as is_active or created_at.
  • Permissions: Custom permission classes to enforce ownership or admin-only access.
  • Pagination: Page-number based pagination integration.
  • URL Routing: Router-based registration for resource endpoints.
  • Testing: Basic tests demonstrating endpoint verification.

Quick Start

Define a UserViewSet, corresponding serializers, and a router configuration; then write a basic test to verify list retrieval.

Frequently Asked Questions about django-drf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure reusable Django REST Framework patterns for ViewSets and serializers?

Reusable Django REST Framework patterns standardize API implementation by defining ViewSets with dynamic serializer selection, read/write serializer variants, and nested representations to ensure consistent REST API structure across projects.

What is the best way to implement custom permissions and filtering in a DRF API?

The best way to implement custom permissions and filtering in a DRF API is by applying custom permission classes for ownership enforcement and integrating django-filter to enable filtering by fields such as is_active or created_at.

How do I set up URL routing and pagination for Django REST Framework endpoints?

URL routing and pagination for Django REST Framework endpoints are set up using router-based registration for resource endpoints and page-number based pagination integration to manage list retrieval responses.

Can I use separate read and write serializers for User-like models in Django REST Framework?

Yes, you can use separate read and write serializers for User-like models in Django REST Framework to handle password processing and nested representations distinctly based on the request method.

How do I write basic tests for DRF API endpoints to verify list retrieval?

You write basic tests for DRF API endpoints to verify list retrieval by defining a ViewSet, corresponding serializers, and a router configuration, then executing tests that validate endpoint responses.

Does this DRF pattern include action-based endpoints and dynamic serializer selection?

Yes, this DRF pattern includes action-based endpoints and dynamic serializer selection within ModelViewSet configurations to apply consistent API structure alongside basic authentication and permissions.