Build a Django Rest API with the Django Rest Framework. Complete Tutorial. There’s a lot to cover so be sure to checkout the chapters below.

Thanks to Algolia.com for the sponsorship and helping make this series possible!

Tutorial Code: https://github.com/codingforentrepreneurs/Django-Rest-Framework-Tutorial

Setup Links
– macOS Setup Blog Post: https://www.codingforentrepreneurs.com/blog/install-django-on-mac-or-linux/
– maOS Setup Playlist: https://www.youtube.com/watch?v=C47c0TXrS-8&list=PLEsfXFp6DpzSP0VAiEgPg0a-A04sa3rkr
– Windows Setup Blog Post: https://www.codingforentrepreneurs.com/blog/install-python-django-on-windows/
– Windows Setup Playlist: https://www.youtube.com/watch?v=gmuu4swNGSk&list=PLEsfXFp6DpzQ33Q5xhD5naEV9K-Z6upZw)
– Linux Setup Blog Post: https://www.codingforentrepreneurs.com/blog/install-django-on-linux-ubuntu/

Links:
– Django: https://www.djangoproject.com/
– Django Rest framework: https://www.django-rest-framework.org/
– Python Requests: https://docs.python-requests.org/en/latest/
– VSCode: https://code.visualstudio.com/
– Python: https://www.python.org/
– Httpbin : https://httpbin.org
– algoliasearch-django package: https://github.com/algolia/algoliasearch-django
– Python JWT Client https://www.codingforentrepreneurs.com/blog/python-jwt-client-django-rest-framework-simplejwt
– Django Cors Headers https://pypi.org/project/django-cors-headers/
– Algolia InstantSearch.js https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/

00:00:00 Welcome to the Django Rest Framework
00:01:54 Tools we are using
00:04:36 Setup Python Virtual Environment, Install Req, and Start Django
00:11:40 Creating a Python API Client
00:27:01 Run Django Project
00:31:16 Create your first API View
00:37:06 Echo GET Data
00:47:10 Django Model Instance as API Response
00:54:45 Django Model Instance to Dictionary
01:00:41 Rest Framework View & Response
01:04:27 Django Rest Framework Model Serializers
01:14:45 Ingest Data with Django Rest Framework Views
01:27:05 Django Rest Framework Generics RetrieveAPIView
01:35:54 Django Rest Framework CreateAPIView
01:41:57 Django Rest Framework ListAPIView & ListCreateAPIView
01:44:36 Using Function Based Views For Create Retrieve or List
01:55:17 UpdateAPIView & DestroyAPIView
02:04:05 Mixins and a Generic API View
02:16:33 Session Authentication & Permissions
02:23:21 User & Group Permissions with DjangoModelPermissions
02:30:55 Custom Permissions
02:45:46 Token Authentication
02:59:45 Default Django Rest Framework Settings
03:07:39 Using Mixins for Permissions
03:13:15 ViewSets & Routers
03:25:51 URLs, Reverse, & Serializers
03:33:47 Model Serializer Create & Update Methods
03:41:47 Custom Validation with Serializers
03:53:04 Request User Data & Customize View Queryset
04:08:44 Related Fields & Foreign Key Serializer
04:24:30 Pagination
04:32:36 A Django Based Search for our Product API
04:48:34 Building your Search Engine on Algolia
05:09:54 Agolia Search Client for Django
05:30:22 Unified Design of Serializers & Indices
05:46:48 JSON WEB Token Authentication with simplejwt
06:00:30 Login via JavaScript Client
06:16:23 Handle Request Blocked by CORS via django cors headers
06:23:53 Using JWT with JS Client
06:39:54 Search via REST API & JS Client
06:48:40 Algolia InstantSearch.js
07:00:35 Thank you and next steps

source

36 Comments

  1. Thanks for watching! Code: https://github.com/codingforentrepreneurs/Django-Rest-Framework-Tutorial
    Chapters:

    00:00:00 Welcome to the Django Rest Framework
    00:01:54 Tools we are using
    00:04:36 Setup Python Virtual Environment, Install Req, and Start Django
    00:11:40 Creating a Python API Client
    00:27:01 Run Django Project
    00:31:16 Create your first API View
    00:37:06 Echo GET Data
    00:47:10 Django Model Instance as API Response
    00:54:45 Django Model Instance to Dictionary
    01:00:41 Rest Framework View & Response
    01:04:27 Django Rest Framework Model Serializers
    01:14:45 Ingest Data with Django Rest Framework Views
    01:27:05 Django Rest Framework Generics RetrieveAPIView
    01:35:54 Django Rest Framework CreateAPIView
    01:41:57 Django Rest Framework ListAPIView & ListCreateAPIView
    01:44:36 Using Function Based Views For Create Retrieve or List
    01:55:17 UpdateAPIView & DestroyAPIView
    02:04:05 Mixins and a Generic API View
    02:16:33 Session Authentication & Permissions
    02:23:21 User & Group Permissions with DjangoModelPermissions
    02:30:55 Custom Permissions
    02:45:46 Token Authentication
    02:59:45 Default Django Rest Framework Settings
    03:07:39 Using Mixins for Permissions
    03:13:15 ViewSets & Routers
    03:25:51 URLs, Reverse, & Serializers
    03:33:47 Model Serializer Create & Update Methods
    03:41:47 Custom Validation with Serializers
    03:53:04 Request User Data & Customize View Queryset
    04:08:44 Related Fields & Foreign Key Serializer
    04:24:30 Pagination
    04:32:36 A Django Based Search for our Product API
    04:48:34 Building your Search Engine on Algolia
    05:09:54 Agolia Search Client for Django
    05:30:22 Unified Design of Serializers & Indices
    05:46:48 JSON WEB Token Authentication with simplejwt
    06:00:30 Login via JavaScript Client
    06:16:23 Handle Request Blocked by CORS via django cors headers
    06:23:53 Using JWT with JS Client
    06:39:54 Search via REST API & JS Client
    06:48:40 Algolia InstantSearch.js
    07:00:35 Thank you and next steps

  2. Yo I like this tutorial, appreciate you really dive in and be thorough with all the moving parts of Django and Rest framework and not just making an app like all the other video does!

  3. Hi, I have a problem. It just doesn't work for me for whatever reason. The pagination doesn't show, and it's exactly the way it was before despite me adding pagination. I checked a few times and i copied it correctly from the there is no error. id don't understand why

  4. You are going waaay too fast, it's better to have less content but better explained, than put everything there but poorly explained because of constant rushing somewhere, it's like you are just waiting to finish it..The real value of a tutorial is measured by how well you explained the content, not the amount of information said in it…Really becomes painful to watch at some point, cause you say 1 thing, but skip 4, and in order to understand the topic you need to know all 5… I'm not saying this video is bad, there is a lot of good information here, but if you really want to know and understand this topic, this is just not enough, too many holes in explaining

  5. I was following the tutorial but encountered a problem in echoing the GET data because maybe I was using the latest versions of Django and DRF. In the video my, body = request.body has an empty output when you print it outputs b'' ". I need help on this !!

Leave A Reply

Please enter your comment!
Please enter your name here