django-drf

Build Django REST Framework APIs with ViewSets, serializers, filters, permissions, and pytest tests.

Updated Mar 23, 2026
One-click install
npx skills add https://github.com/giruclawbot/giru-backup --skill django-drf-giruclawbot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: django-drf
Source: https://github.com/giruclawbot/giru-backup/tree/main/skills/django-drf
Command: npx skills add https://github.com/giruclawbot/giru-backup --skill django-drf-giruclawbot

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides clear, reusable patterns to avoid repetitive boilerplate when building REST APIs with Django and Django REST Framework, helping teams implement consistent ViewSets, serializers, filters, permissions, pagination, routing, and tests.

Core Features & Use Cases

  • ViewSet patterns for centralizing CRUD behavior and custom actions using ModelViewSet and router registration.
  • Serializer separation with distinct read, create, and update serializers to enforce write-only fields and custom creation logic.
  • Filtering, permissions, and pagination patterns including FilterSet usage, custom permission classes, and a standard pagination class.
  • Testing guidance with pytest fixtures and APIClient examples to verify endpoints and authentication flows.
  • Use Case: Implement a user management API that supports listing, creating, updating users, filtering by email and creation date, applying owner or admin permissions, and paginating results.

Quick Start

Create a ModelViewSet with separate read and write serializers, register it on a DefaultRouter under api/v1, and add a FilterSet and permission class to enable filtering and secure access.

Frequently Asked Questions about django-drf

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

FAQPage Schema
How do I structure Django REST Framework ViewSets and serializers to reduce boilerplate?

Django REST Framework boilerplate is reduced by using ModelViewSet to centralize CRUD operations and separating read, create, and update serializers to enforce write-only fields and custom creation logic.

What is the best way to add filtering and pagination to a DRF API?

Filtering and pagination in a DRF API are configured by integrating django-filter FilterSets for query parameter filtering and applying a standard pagination class to limit and structure list responses.

How do I implement custom permissions in Django REST Framework?

Custom permissions in Django REST Framework are implemented by defining permission classes that enforce access control, such as restricting endpoints to owners or admins based on request user attributes.

How do I test DRF API endpoints and authentication with pytest?

DRF API endpoints are tested using pytest fixtures and APIClient examples to verify CRUD operations, authentication flows, and filtering behavior across user, post, and admin endpoints.

Can I use separate serializers for create and update flows in DRF?

Separate serializers for create and update flows in DRF are supported by defining distinct serializer specializations that handle write-only fields and custom creation logic for specific HTTP methods.

How do I register DRF ViewSets with URL routing?

DRF ViewSets are registered with URL routing by using a DefaultRouter to automatically generate URL patterns, typically structured under an api/v1 prefix for consistent REST API exposure.