i have gone throught so many youtube tutorials,videos but never got understand in depth how rest is actually works and landed here now everything is crystal clear
Amazing content! I do have a question for you. How would you set the custom permissions if for example a User belongs to a company and there are several companies with several users and you want to only return the data belong to a specific company depending on the user that's logged in! Kind of like a dashboard shared between several companies. Would you request something like user.company (from the user model) and filter the query object? I apologize if my question doesn't make any sense. Thanks
This series is so helpful but I do want to ask a question how do you implement an IsOwner custom permission if you have many-to-many field for like the author in this example. What I mean is that only the authors who has the permission to modify the post.
What is the point of extending PostUserWritePermission in PostDetail class? Why should View class be extended from Permission? You already used composition by setting permission_classes Tuple.
Great video sir. I have a question. In order for custom permission to work in the views, do you need create 'Group' and set 'User Permission ' in the admin panel? For some reason custom permission does not work - the custom permission in Detail view do not give PUT, DELETE . only read-only.
Is it possible to do this with django templates? How would you pass the data to the templates (just like it's done with pure django) but using rest framework? I'm trying to get the advantage of object level permissions and also keeping the door open for a future use of react etc...
I think I covered some of your question not too long ago in a mini series. I have yet to get to permissions with the API. My wife keeps asking will I run out of content. I just smile, by the time I get around to everything just Django related, Django would have changed so much I would have to re-make all the tutorials again.
@@veryacademy That is so true. Don't forget plenty of available extensions. I don't know if you've already covered django-channels but it's really big and fun to make things with.
While directly mentioning the class in permission_classes might work in some cases, using a custom permission class provides a more modular and maintainable approach, especially as your application grows in complexity.
@@veryacademy can you please elaborate more, i dint get the part that it may work in some cases also inheritance is different than setting an attribute, hency why do we need to inherit when official document says to pass it as a value to permission_classes attribute
On testing the permission I got an error when test posting the author with errors "{'author': [ErrorDetail(string='Invalid pk "1" - object does not exist.', code='does_not_exist')]}" Is this because the model is a foreign key? Is there any solutions that could help me, btw i'm using MySQL and Axios not Fetch and sqlite3
I wanted to get your courses through Udemy Business, but out of 9 only 2 of your courses were available. Can you make all of your courses available in Udemy Business?
Hi Rafael, indeed we can. Take a look at creating some permissions. Won’t be too long now I will be creating a series of tutorials on the topic. It is one of the most requested topics.
Sir i noticed two problems First one is with prepopulated slug ,when i use django admin dashboard to create post slug prepopulated correctly but when use rest api to create post the slug field doesn’t prepopulated, it’s empty field The second problem is with DjangoModelPermissions i gave user only add permission and it works fine with django admin dashboard and i just can add and can’t read ,but in rest api the user can read ,add, delete I hope you sir answer me or give me resources to understand the reasons of these problems
Hello! I express my gratitude for the lessons. I have a question : when i make test i get: return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 984, in _find_and_load_unlocked ModuleNotFoundError: No module named 'rest_framework' Who got result of test like my? And find good soluiton...
i have gone throught so many youtube tutorials,videos but never got understand in depth how rest is actually works and landed here now everything is crystal clear
A pure Gold content, A solid series in youtube not only in using the framework but understanding entire web development.
👍
This was so beautifully explained! Your voice is so soothing and reassuring. Thanks for posting!
You are so welcome!
I will comment just so youtube improve it algorithm
high-quality content here
Thank you! Love your approach to the algorithm - every little helps
so far , so good, rarely found a video tuto ,which explain the step by step like this , thx again ...
Glad it helped 👍
You are the best ..Zender.. ! Thank you so much..!
You're welcome!
A beautiful series (all the series in the channel) with great content well presented and organized with a lot of effort, congratulations
agreed
you explain very clearly. thanks😍
YOU ARE AMAZING DUDE
Too kind
Amazing explanation , specially testing part!
Better than many paid django-rest courses....Keep it up...your channel is definitely gonna grow.
Thank you 👍
Django Rest Framework tutorial marathon lets goooo
It really feels that way 😂 another big one tomorrow JWT Authentication front and back-end!
@@veryacademy Waiting...
great video as usual
🙏
Amazing tutorial, great to focus on writing tests right from the start, here's your comment for the algorithm :)
This is really good stuff
very helpful video sir thanks for making this series
Most welcome
As usual.... top stuff!
Thanks again! 👍
Dope. That was really really helpful
Wish me luck while I update my project to use DRF
Best of luck!
Nicely done , logical flow of information and examples.
Thank you bruh .
keep up
dont loose your motivation
god blesses you
👍
Thank you so much. This is exactly what I needed, your lectures help me a lot especially the testing part
Awesome in-depth videos with theory good work👍👍pls keep this going...
Thanks, will do! 👍
Really nice serie, thx a lot!
You're very welcome!
Great video!
Wonderful video. Thank you! :)
Thank you too!
Amazing content! I do have a question for you. How would you set the custom permissions if for example a User belongs to a company and there are several companies with several users and you want to only return the data belong to a specific company depending on the user that's logged in! Kind of like a dashboard shared between several companies.
Would you request something like user.company (from the user model) and filter the query object? I apologize if my question doesn't make any sense. Thanks
this is also my problem @Anshul Dubey do you got an answer or solution to this?
@@user___01 up
Thanks Sir. Great work.
Thank you - any question or issues just let me know.
This series is so helpful but I do want to ask a question how do you implement an IsOwner custom permission if you have many-to-many field for like the author in this example. What I mean is that only the authors who has the permission to modify the post.
Love you for your effort ❤
Thank you so much 😀
What is the point of extending PostUserWritePermission in PostDetail class? Why should View class be extended from Permission? You already used composition by setting permission_classes Tuple.
Nice sir keep it up 👍💪💪💪
Thank you, I will 🐱🏍
Great video sir. I have a question. In order for custom permission to work in the views, do you need create 'Group' and set 'User Permission ' in the admin panel? For some reason custom permission does not work - the custom permission in Detail view do not give PUT, DELETE . only read-only.
your tutorials are the best!! could you make an tutorial how to make I like button in both sides django and react?
Golden Inf, THANK YOU
Hi Zander, I was wondering why do we extend the Custom class as well and pass it to the persmissions_classes array for the detail view?
Awesome
Thank you 👍
Is it possible to do this with django templates? How would you pass the data to the templates (just like it's done with pure django) but using rest framework?
I'm trying to get the advantage of object level permissions and also keeping the door open for a future use of react etc...
I think I covered some of your question not too long ago in a mini series. I have yet to get to permissions with the API. My wife keeps asking will I run out of content. I just smile, by the time I get around to everything just Django related, Django would have changed so much I would have to re-make all the tutorials again.
@@veryacademy That is so true. Don't forget plenty of available extensions. I don't know if you've already covered django-channels but it's really big and fun to make things with.
My question is that how could you understand the documentation of this permission section on the webpage. I read through it and I got so confused.
I know how you feel, sometimes they are not very friendly. As you knowledge of code and Django develops you will understand it more so. 👍
Aula muito boa!
Why do we need to Inherit PostUSerWritePermission ? Will mentioning this class as permission_classes won't suffice ?
While directly mentioning the class in permission_classes might work in some cases, using a custom permission class provides a more modular and maintainable approach, especially as your application grows in complexity.
@@veryacademy can you please elaborate more, i dint get the part that it may work in some cases also inheritance is different than setting an attribute, hency why do we need to inherit when official document says to pass it as a value to permission_classes attribute
On testing the permission I got an error when test posting the author with errors "{'author': [ErrorDetail(string='Invalid pk "1" - object does not exist.', code='does_not_exist')]}"
Is this because the model is a foreign key?
Is there any solutions that could help me, btw i'm using MySQL and Axios not Fetch and sqlite3
Sounds like there is no data in the database or you are selecting the wrong data in the database?
I wanted to get your courses through Udemy Business, but out of 9 only 2 of your courses were available.
Can you make all of your courses available in Udemy Business?
Do me a favor and ask/beg Udemy customer services, I have no control over it.
when we create a post using the post view why it didnot saved in the temporary database ?!
is there a way to restrict someone from creating a Post as another user? looks like your user aaaa can create a post as admin
Hi Rafael, indeed we can. Take a look at creating some permissions. Won’t be too long now I will be creating a series of tutorials on the topic. It is one of the most requested topics.
Thank you 🙏🏼🙏🏼
You are so welcome 👍
Sir i noticed two problems
First one is with prepopulated slug ,when i use django admin dashboard to create post slug prepopulated correctly but when use rest api to create post the slug field doesn’t prepopulated, it’s empty field
The second problem is with DjangoModelPermissions i gave user only add permission and it works fine with django admin dashboard and i just can add and can’t read ,but in rest api the user can read ,add, delete
I hope you sir answer me or give me resources to understand the reasons of these problems
Really sorry it is difficult to help you in a meaningful way. I have noted the issues and will use it to deliver further content.
how can we store the author name also in the post model ,so we can retrieve it when we serialize
Hello! I express my gratitude for the lessons.
I have a question : when i make test i get:
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'rest_framework'
Who got result of test like my? And find good soluiton...
and if I want to list only the posts of the logged in user?
You need to create a query for example - Post.object.filter(user=1)
15:57 forgot the password, hahaha