Django REST Framework - Serializers & Response objects | Browsable API
BugBytes BugBytes
31K subscribers
1,145 views
127

 Published On Oct 2, 2024

☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
https://ko-fi.com/bugbytes

In this video, we'll look at Django REST Framework ModelSerializers, and how we can use these to convert Django models and QuerySets to JSON data. We'll also look at the REST Framework Response object, the api_view() decorator, and the REST Framework Browsable API.

Starter Code: https://github.com/bugbytes-io/drf-co...

📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
00:26 Adding Django REST Framework to INSTALLED_APPS
01:00 Creating a ModelSerializer with REST Framework
06:56 Field level validation on serialises
09:42 Writing Django view function to return serialised data
14:37 REST Framework Response objects
17:29 REST Framework Browsable API and Renderers
20:24 Serializing a single Django model in a detail view

𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: https://bugbytes.io/posts/
👾 Github: https://github.com/bugbytes-io/drf-co...
🐦 Twitter:   / bugbytesio  

📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
Starter Code: https://github.com/bugbytes-io/drf-co...
Serializers: https://www.django-rest-framework.org...
Serializer Fields: https://www.django-rest-framework.org...
DRF Response objects: https://www.django-rest-framework.org...
DRF Browsable API: https://www.django-rest-framework.org...

#python #django #webdevelopment #djangorestframework

show more

Share/Embed