☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
https://ko-fi.com/bugbytes
⭐Top resource to learn Python - https://datacamp.pxf.io/kOjKkV ⭐
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-course-api
📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
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-course-api
📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
Starter Code: https://github.com/bugbytes-io/drf-course-api
Serializers: https://www.django-rest-framework.org/api-guide/serializers/
Serializer Fields: https://www.django-rest-framework.org/api-guide/fields/
DRF Response objects: https://www.django-rest-framework.org/api-guide/responses/
DRF Browsable API: https://www.django-rest-framework.org/topics/browsable-api/
#python #django #webdevelopment #djangorestframework