django-drf

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

Updated Mar 15, 2026
One-click install
npx skills add https://github.com/sebasmzg/sebas.dot --skill django-drf-sebasmzg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: django-drf
Source: https://github.com/sebasmzg/sebas.dot/tree/main/.config/opencode/skill/django-drf
Command: npx skills add https://github.com/sebasmzg/sebas.dot --skill django-drf-sebasmzg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides concise, reusable patterns and examples to reduce boilerplate and design inconsistencies when implementing REST APIs with Django REST Framework, making it easier to implement viewsets, serializers, filters, pagination, and permissions correctly.

Core Features & Use Cases

  • ViewSet patterns for model-backed CRUD endpoints and custom actions to keep controllers consistent and testable.
  • Serializer strategies with distinct read, create, and update serializers to enforce field-level rules and secure password handling.
  • Filtering and pagination examples using django-filter and PageNumberPagination for efficient list endpoints.
  • Permissions and testing guidance with custom permission classes and pytest-based API tests to validate behavior.
  • Use Case: Implement a users API with separate serializers for creation and updates, filters for email and date ranges, paginated lists, and custom activate/deactivate actions.

Quick Start

Create a DRF ModelViewSet with separate serializers for create/update/read, add django-filter FilterSet for common query params, enable StandardPagination, and write pytest tests for listing and creation.

Frequently Asked Questions about django-drf

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

FAQPage Schema
How do I structure separate serializers for create, update, and read operations in Django REST Framework?

You can use separate create, update, and read serializers in Django REST Framework to enforce field-level rules and secure password handling. This strategy isolates input validation from output representation within your ModelViewSet endpoints.

What is the best way to add filtering and pagination to a Django REST Framework list endpoint?

Integrate django-filter FilterSets for query parameters like email and date ranges alongside PageNumberPagination. This combination ensures efficient, structured list endpoints in Django REST Framework.

How do I implement custom actions like activate or deactivate on a DRF ModelViewSet?

Implement custom actions like activate or deactivate on a DRF ModelViewSet using the action decorator. This extends standard CRUD operations while keeping controllers consistent and testable.

Can I enforce custom permission classes and write pytest tests for my Django REST API endpoints?

Yes, you can enforce custom permission classes and write pytest-based API tests to validate endpoint behavior. This ensures access control rules are applied and verified across viewsets and custom actions.

Does django-filter work with PageNumberPagination for date range queries in a DRF API?

Yes, django-filter works with PageNumberPagination to handle date range queries in a DRF API. Applying a FilterSet allows common query params while pagination controls the volume of returned list data.