Build a Django REST API with the Django Rest Framework. Complete Tutorial.
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: github.com/codingforentrepren...
Setup Links
- macOS Setup Blog Post: www.codingforentrepreneurs.co...
- maOS Setup Playlist: • Install Python 3.8 and...
- Windows Setup Blog Post: www.codingforentrepreneurs.co...
- Windows Setup Playlist: • Install Python 3.8 on ... )
- Linux Setup Blog Post: www.codingforentrepreneurs.co...
Links:
- Django: www.djangoproject.com/
- Django Rest framework: www.django-rest-framework.org/
- Python Requests: docs.python-requests.org/en/l...
- VSCode: code.visualstudio.com/
- Python: www.python.org/
- Httpbin : httpbin.org
- algoliasearch-django package: github.com/algolia/algoliasea...
- Python JWT Client www.codingforentrepreneurs.co...
- Django Cors Headers pypi.org/project/django-cors-...
- Algolia InstantSearch.js www.algolia.com/doc/guides/bu...
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
Пікірлер: 449
Thanks for watching! Code: 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
@Mauri6870
Жыл бұрын
Would you be able to number these timestamp sections to match with the branches that exist in the github repo?
Man teaching 7 Hrs Django Rest framework tutorial without any Rest, impressive!
@CodingEntrepreneurs
2 жыл бұрын
Ha. What parent gets sleep? Not this one 😂
@UsedYourName
2 жыл бұрын
lol he’s the goat I love this mf on god
@mrcruz1107
Жыл бұрын
Seriously though. was there a single cut/edit in this vid?
@siorno
12 күн бұрын
@@mrcruz1107 every single time he put a title on the screen, and from the way he spoke it sounded like multiple videos spliced together
I just wanted to let you know, that this tutorial was probably one of the biggest reasons I got a job offer as a backend developer. I really like your in depth approach showing all the mechanisms happening in the background. Thank you!
@CodingEntrepreneurs
Жыл бұрын
That’s amazing! Thank you for sharing. Also, good for you for doing the work. Keep it up!
@aryanjain5535
Жыл бұрын
me when
@cyberpirate007
2 ай бұрын
Yea Same here!!! Got an Internship offer and dudes one of the reason. Gratitude ❤️
@maazshaikh7905
28 күн бұрын
can you please explain the roadmap you followed for django and the projects.
This tutorial is gold, I'm very new to this but the way it is being explained is very good. The style of showing the hard way and showing the more practical way helps you understand the value of the already created frameworks.
Thanks very much for creating this course! I'm around 30 minutes in and loving it so far. I'm actually a .NET REST API Developer at a large tech firm and I'm really enjoying learning more about Python and the Django REST Framework. This is a great course to shore up my fundamentals and strengthen my ability as an API Dev.
it's been a long journey that your channel raised up my career life with python and django stuffs. i can't even describe how thankful your support is. your channel made a person to a good developer . Thank You So Much. Hope you well and happy. Have a Good Day
This is amazing, 7hrs of free, sought after content. Thank you! Love the way he teaches with so much confidence. I hope to be like him someday 🙏🏽
I swear when it comes to Django related content This guy definitely is the first one I think of Thank you so so much for putting in the time and explained very clearly Love and support
I just want to say thank you. I'm currently building out a own project, that requires a heavy backend framework and this really gave me a comprehensive understanding of the topic (not only drf but APIs and Backends in general). It's amazing that this stuff is on the internet for free. Keep up the brilliant work.
@CodingEntrepreneurs
2 жыл бұрын
Thank you!!
@pavanprakash3030
2 жыл бұрын
@@CodingEntrepreneurs great
Woooow! whatever I do can’t pay for your work, Really thank you. I was looking for Rest tutorial for a while and non was good, then suddenly saw your tutorial 😍 you don’t know how much I am happy and confident when see a tutorial from you.
I remember I started watching this video and had to pause for my exam. Then I started again a day before and must admit this entire video is very well thought out. Thank you CFE.
Thank you so much for this course. Just found a job while transitioning from flask to django. You deserve all the best!!!
justin, the content you give us for free is just too good to be true, i just opened youtube at work and i couldn't be much happier, just the tutorial i wanted to dig deeper and learn more. thank you.
@CodingEntrepreneurs
2 жыл бұрын
Thank you! Your joy brings me joy.
This is amazing!!! Thank you for taking the time to teach such valuable topics. Not only this one but your entire Django series. Much love from Costa Rica!
This is by far one of the best tutorials I have ever seen. Thank you so much!
As I get more experienced as a developer, it gets harder to find content beyond the simplest of CRUDs for some technologies and a lot of tImes I end up just reading the documentation. I really like your approach here. It seems like you're trying to show as many DRF's features as possible while making them useful so that we can remember them and use them as needed, while trying to keep the quality one would expect on a production environment, and it works. Your video helped me a lot. Thank you.
Sir.... You had NO IDEA on how close I was to buy a Udemy course on REST Framework!!! Absolute Timing!!! Thank You Sir!!
@kamilszczepanik9579
2 жыл бұрын
Was it worth it? I mean wouldn't it be better to buy a good one on udemy?
@sahilkumar-zp7zv
Жыл бұрын
@@kamilszczepanik9579 This is a good one
Thank you so much for the way this is all presented, taking the time to build up the use cases and adding complexity slowly in a way that flows. Other django/react projects I've tried to follow just throw out the end product as if its obvious why anything is the way it is
sir, you''re a life saver, I am looking for a course of latest drf for the past weeks and just saw this, thank you sir!
Really amazing explanation. This was very helpful, especially when you do things in the hard way and then say how to do it much easier with another technique. This is really help in understanding how things work. Thank you very much.
The best tutorial I've ever seen about DRF. Thank you.
Your tutorials are super valuable! Thanks for helping me understand what my colleagues do :)
This is the thing that we want from you about Django... Now everything about framework is on your channel 🤘
Best drf course on KZread so far... Thank you so much.
Absolutely amazing tutorial about Django rest framework. I am 1 and a half hours into it. Loved it!
@CodingEntrepreneurs
Жыл бұрын
Thank you! Glad you’re enjoying it.
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!
This guy is incredible specialist, he knows what he is doing. Thanks I learned a lot, some tasks were too much for me, but still It was great.
you are the best fast talking and telling whats really important great job dude
Dear Justin, I wanted to take a moment to express my sincere gratitude for the amazing tutorial series you've created on Django Rest Framework. Your efforts and clear explanations have made the learning process incredibly smooth for me. Not only have you taught Django Framework effectively, but your insights into Django Rest Framework have been invaluable. Your dedication to teaching shines through, and I truly appreciate the effort you've put into creating such high-quality content. As someone eager to delve into professional Django development, I'm convinced of the importance of solid guidance for production-level work. Hence, I would like to extend my heartfelt thanks and best wishes to you. Your tutorials have laid a strong foundation for many of us, and I'm sure I speak for many when I say that your expertise is highly valued. If it's not too much to ask, could you perhaps consider creating a guide or series focused on best practices for Django Rest Framework in a professional setting? Topics such as Django user authentication, deployment and other industry best practices would be immensely helpful. Once again, thank you for your outstanding work, and I eagerly await any further insights you may share. Best regards, Rasel Rana Bangladesh
@CodingEntrepreneurs
5 ай бұрын
Thank you for this! You made my day. Who else wants to see authentication with DRF?
@r125l6
5 ай бұрын
You're welcome, Justin! Your tutorials have truly made a difference for many of us. Keep up the amazing work!@@CodingEntrepreneurs
@SophiaRatri
5 ай бұрын
@@CodingEntrepreneursThank you for your dedication to teaching Python and Django, Sir. Your consideration for addressing production challenges, particularly in authentication with Django Rest Framework, is highly appreciated. I earnestly urge you to create a tutorial focusing on production-ready DRF authentication, including custom user implementation and other crucial aspects. Your guidance in this area would be invaluable, and I'm certain many of us would benefit greatly from following your recommended path while implementing these solutions.
@JustinaNockreck
5 ай бұрын
@@CodingEntrepreneursAbsolutely, Justin! Count me in for a deep dive into DRF authentication-it's exactly what I've been eager to learn. Thanks for your outstanding tutorials ❤
@Oliviya__007
5 ай бұрын
@@CodingEntrepreneursCertainly, Justin! I'm eagerly awaiting your tutorial on DRF authentication-it's a topic I'm highly interested in.
Este es el curso más claro y mejor explicado de DRF que he encontrado. Excelente tutorial, muy completo
Love your courses, Thanks for your comprehensive knowledge on topics.
i can't thank enough for these tutorials, they are really helpful.
Until now is the best Django tutorial and I tried a bunch from udemy and youtube. I want to thank you a lot!
MAAAN, this course is awesomly awesome (completed it). The topics & the explanation are well put together, thanks for this course. Love from Egypt
More amazing content to help me become a better Django developer! I am super excited to go through this! Thanks so much Justin!
@CodingEntrepreneurs
2 жыл бұрын
Thank you!
I really like it. I like the serializers part, I didn't get it at first from the documentaion. Thanks for the amazing demonstration.
Watching your video was the best decision I've made after suffering from not getting a low level perspective of how APIs work
@CodingEntrepreneurs
11 ай бұрын
You made my day. Thank you
Waao, i had complete the tutorial, very well and clear explained, all examples work as expected. Thank you a lot!!!
Great timing, I was going to search for DRF tutorials. Love your tutorials
@CodingEntrepreneurs
2 жыл бұрын
Thank you
This is absolutely fantastic! I got udemy courses, this is way beyond. This 7 hour course is equivalent to 25 hours in udemy. Thank you for your effort and amazing content!
I have to come back after over 3 hrs into this video to drop this comment. Thank you for taking your time to make such a great content. The video is lit!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 🔥🔥🔥🔥🔥
man tnk u so much for creating because it really teaches me a lot about drf api and some other part of django that i am lacking, loved it so much, i am done with the vid
Just finished Try Django today after 30 Days of Python. Very excited for this.
A long long awaited tutorial, Thank you justin bro
Incredibly valuable! Keep up the good work!
Literally got a job because of you and your tutorials, that twitter app, blog app and all the other projects. thanks.
@CodingEntrepreneurs
2 жыл бұрын
I’m glad my tutorials helped, but you still did the work. Good for you. Cheers!
teaching rest_framework without rest, GOAT🎉🎉 I'm subscribing
Great tutorial lots of useful stuff much more than in some paid courses. The only drawback is the exposure speed, too fast for me, but I set the playback speed to 0.5 and now it's great :)
Thank you so much for this crash course, the best i ever seen
Thank you so much for your video. Your video is helping me a lot in understanding Django, especially DRF. I hope you always have amazing days!
Man, you are awesome at teaching django. Superb.
I usually never comment a video but I'd like to praise your work as it deserved to be ! Thanks for this awesome content. If we can support you in anyway, let us know !
Before now, I never knew I could pass instance method as one of the serializers fields. Thanks a lot Justin.
This tutorial is very helpful for both novices and even experienced developers! Great tutorial, but there were a few moments where you sped up your writing and speaking, which may confuse the listener :D Hopefully YT allows us to pause or rewind video
the best django course for beginners I've ever seen
Oh my good this is was unexpected I think the whole document are here Really thank you
Brilliant tutorial! Waiting for more about other frameworks like FastAPI :D
OMG. Justin. This all is for free. Thank you very very much.GOD BLESS YOU!!!
Thank you so much, it was an amazing course. you helped me understand pretty much every aspect of DRF and even implement search using Algolia and more. I can't even say it... THANK YOU
amazing tutorial, I was having a hard time finding something as good as this
Though this is going over my head but i found this video the best one for drf across youtube, Anyway stumbling and learning seems interesting.
Subbed. Thanks for taking the time to make this.
nicely prepared and thanks for the work you put in for us
wow it is a fantastic course on DRF, it solved lots of my ambiguities and clear them out for me , I learned a lot from you thanks about that
Thanks, for simplifying the process of learning API Development in Django.
Top Course on Rest Framework. So much value
Thank you very much i have learnt so many things from your channel . Lover from Bangladesh
Thank you so much for this, I am learning and having fun doing it watching you, amazing!!
@CodingEntrepreneurs
Жыл бұрын
Thank you!
so looking forward to this one.... Thanks bro!
super helpful insight, thank you alot for the course.
I LOVE THE WAY UR DISPLAYING ALL THE ERROR TO MAKE THINGS BETTER FOR US, THANKS YOU AND LOVE YOU AND GOD BLESS YOU.
@CodingEntrepreneurs
2 жыл бұрын
Thank you!!!
Wow this is so thorough!
That's amazing. I'm really appriciate with your work.
Fantastic!!!! Thanks a lot for your great effort 💖
I can't express in words....all I can say is thank you so much
@CodingEntrepreneurs
2 жыл бұрын
Thank you for watching
Thanks for the tutorial! Best of Luck!
The best django youtube channel 💪💪🔥🔥🔥
Such a good tutorial! Thanks for the work! The only part I'am missing is: How to save foreign keys or m2m via API and how about saving images via DRF. Would be awesome if you have some best practices links to do it? Or maybe you feel like doing another tutorial? Would be awesome :)
Awesome mentor, how did you spend 7 hours explaining the rest framework? You are the reason why I started programming 7 years ago.
Thank you, really appreciate this course
Frankly Can't find better content that only focuses on Django. Great as always Justin, Material is gold as always. Thanks
@CodingEntrepreneurs
2 жыл бұрын
Thank you!
Thanks for this tutorial, this has so much great information.
Thank you for posting amazing content like this, all explained , best practices and the best instructor in the internet please keep doing more of this amazing work.
Honestly, You are a helping hand! God Bless You!
@CodingEntrepreneurs
2 жыл бұрын
Thank you!
Thank you so much, this is fantastic!!!
Your absolutely awesome, you made this stuffs easy, I recommends this video to new viewer, It worth watching
Thank you for your time. I appreciate it.
Fantastic vid as usual 👍
Thank you very much for the Quality Knowledge 👌
Awsome course so much information, it took me 3 weeks, I learned a lot....thank you so much.....greetings from South America :)
@CodingEntrepreneurs
2 жыл бұрын
Thank you!
Yes! So glad to see a new video :D
I was really feeling overwhelmed trying to learn Django for an idea of a app startup I had. Went through the official Django docs and some half finished udemy courses, but didn't really grasp the concepts. I was about to give up, until I saw this tutorial and Dennis Ivy's "DRF Oversimplified". Now I understand how things work BIG THANK YOU
@CodingEntrepreneurs
5 ай бұрын
Way to stick with it!
@frederickah88
2 ай бұрын
I'm new to Django Can I just learn DRF without learning Django? Or should i need to learn Django first and comeback to this video?
@mmcuser
2 ай бұрын
@@frederickah88 I would learn some django before. Is what Is did. I was not an expert but I could run a simple app. its easier this way, as this tutorial is really dense and fast (which I like)
thanks a lot for this tutorial, this is very helpful & i am very happy ! Easy to learn because it has its own branch per section ^^ :)
this is sooo good.. i'm interested more about the tutorial.. 🥳
this is extremely comprehensive course, more than premium than almost of the premium course available out there.
@CodingEntrepreneurs
Ай бұрын
Thank you!
Good channel following from past 5years on words. 👍
@CodingEntrepreneurs
2 жыл бұрын
Thank you!
man you're a life saver thank you
This is indeed a very good tutorial Well explanation at all!!
Very helpfull information in one place. Thank you!
Amazing! Thank you man!