#DRF

Django & DRF Model Generic Auth Stuff

Tracking who created or updated a record is vital for auditing. This article shows how to automatically populate created_by and updated_by fields in Django REST Framework by leveraging HiddenFields, reducing boilerplate and improving data integrity

Mohamed Nossirat
Django & DRF Model Generic Auth Stuff

Django Rest Framework rich related serializer

Readable API responses shouldn’t compromise write operations. This article introduces a custom serializer field derived from DRF’s PrimaryKeyRelatedField that returns nested objects for reads while accepting primary keys for writes, yielding cleaner responses without sacrificing flexibility.

Mohamed Nossirat
Django Rest Framework rich related serializer