DRF

3 essays tagged DRF · All articles

2025

  1. Django REST Framework: when (and when not) to override serializers and viewsets, part 2

    Part 2 covers ViewSets: when to override create versus perform_create, how update, partial_update, and perform_update fit together, and a cheat sheet for where each kind of logic goes.

    6 min read · Django REST Framework overrides, part 2 of 2

  2. Django REST Framework: when (and when not) to override serializers and viewsets, part 1

    Part 1 covers serializers: which methods to override for validation, saving, and output formatting, and what logic does not belong in a serializer at all.

    4 min read · Django REST Framework overrides, part 1 of 2

  3. Why Django REST Framework doesn't show your custom validation error messages (and what to do about it)

    DRF validates at the serializer level and skips model full_clean(), so custom messages on model constraints never reach the API response. Three ways to work around it.

    2 min read