Skip to content

Opinionated Django REST Framework patterns for ViewSets, serializers, filters, permissions, and routing in Prowler's API.

CCM score
64 of 100
skills.sh installs
484
GitHub stars
15.3K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers a 10-step endpoint checklist from models and ViewSets through OpenAPI schema and changelog fragments
  • Enforces serializer separation by operation (Read, Create, Update, Include) and filterset_class over filterset_fields
  • Requires swagger_fake_view guards and select_related/prefetch_related in get_queryset() to prevent N+1 queries
  • Designed for contributors adding generic DRF endpoints in api/, with prowler-api covering RLS, RBAC, and provider specifics

Install

$ npx -y skills add prowler-cloud/prowler --skill django-drf -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Critical Patterns

  • ALWAYS separate serializers by operation: Read / Create / Update / Include
  • ALWAYS use filterset_class for complex filtering (not filterset_fields)
  • ALWAYS validate unknown fields in write serializers (inherit BaseWriteSerializer)
  • ALWAYS use select_related/prefetch_related in get_queryset() to avoid N+1
  • ALWAYS handle swagger_fake_view in get_queryset() for schema generation
  • ALWAYS use @extend_schema_field for OpenAPI docs on SerializerMethodField
  • NEVER put business logic in serializers - use services/utils
  • NEVER use auto-increment PKs - use UUIDv4 or UUIDv7
  • NEVER use trailing slashes in URLs (trailing_slash=False)

Note: swagger_fake_view is specific to drf-spectacular for OpenAPI schema generation.


Implementation Checklist

When implementing a new endpoint, review these patterns in order:

Details

Repository
github.com/prowler-cloud/prowler
Categories
Backend & APIs, Python
First seen
Jun 3, 2026

More from prowler-cloud/prowler

All 6

Similar to Django Drf

More Backend & APIs