Django Rest Framework Series - Permissions and Custom Permissions - Part-2

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

ความคิดเห็น • 88

  • @anand_dudi
    @anand_dudi 3 ปีที่แล้ว

    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

  • @adahal39
    @adahal39 3 ปีที่แล้ว +3

    A pure Gold content, A solid series in youtube not only in using the framework but understanding entire web development.

  • @alpstinger5083
    @alpstinger5083 3 ปีที่แล้ว +6

    This was so beautifully explained! Your voice is so soothing and reassuring. Thanks for posting!

  • @tarassavchenko2317
    @tarassavchenko2317 4 ปีที่แล้ว +3

    I will comment just so youtube improve it algorithm
    high-quality content here

    • @veryacademy
      @veryacademy  4 ปีที่แล้ว

      Thank you! Love your approach to the algorithm - every little helps

  • @mateusjunior1937
    @mateusjunior1937 3 ปีที่แล้ว +2

    so far , so good, rarely found a video tuto ,which explain the step by step like this , thx again ...

  • @felixfigueroa
    @felixfigueroa 3 ปีที่แล้ว +1

    You are the best ..Zender.. ! Thank you so much..!

  • @mohammedezzi6096
    @mohammedezzi6096 3 ปีที่แล้ว +6

    A beautiful series (all the series in the channel) with great content well presented and organized with a lot of effort, congratulations

    • @VskiDevs
      @VskiDevs 2 ปีที่แล้ว

      agreed

  • @shahlagaribi7968
    @shahlagaribi7968 ปีที่แล้ว +1

    you explain very clearly. thanks😍

  • @kaushik.aryan04
    @kaushik.aryan04 ปีที่แล้ว +1

    YOU ARE AMAZING DUDE

  • @abdelhamidrobaa
    @abdelhamidrobaa 7 หลายเดือนก่อน

    Amazing explanation , specially testing part!

  • @mostafarafid3593
    @mostafarafid3593 3 ปีที่แล้ว +7

    Better than many paid django-rest courses....Keep it up...your channel is definitely gonna grow.

  • @whichdude420
    @whichdude420 4 ปีที่แล้ว +2

    Django Rest Framework tutorial marathon lets goooo

    • @veryacademy
      @veryacademy  4 ปีที่แล้ว +1

      It really feels that way 😂 another big one tomorrow JWT Authentication front and back-end!

    • @KrishnaManohar8021
      @KrishnaManohar8021 4 ปีที่แล้ว

      @@veryacademy Waiting...

  • @dennisasamoah2213
    @dennisasamoah2213 2 ปีที่แล้ว +1

    great video as usual

  • @MrKeepItTrill
    @MrKeepItTrill 3 ปีที่แล้ว

    Amazing tutorial, great to focus on writing tests right from the start, here's your comment for the algorithm :)

  • @otobongedoho9018
    @otobongedoho9018 3 หลายเดือนก่อน

    This is really good stuff

  • @abhikb
    @abhikb 4 ปีที่แล้ว +2

    very helpful video sir thanks for making this series

  • @docetes
    @docetes 3 ปีที่แล้ว +1

    As usual.... top stuff!

  • @FreeDomSy-nk9ue
    @FreeDomSy-nk9ue 2 ปีที่แล้ว +1

    Dope. That was really really helpful
    Wish me luck while I update my project to use DRF

  • @TheBodybuildingG
    @TheBodybuildingG 3 ปีที่แล้ว

    Nicely done , logical flow of information and examples.

  • @elonmusk2142
    @elonmusk2142 4 ปีที่แล้ว +1

    Thank you bruh .
    keep up
    dont loose your motivation
    god blesses you

  • @punch12341
    @punch12341 3 ปีที่แล้ว

    Thank you so much. This is exactly what I needed, your lectures help me a lot especially the testing part

  • @samjoel4152
    @samjoel4152 4 ปีที่แล้ว

    Awesome in-depth videos with theory good work👍👍pls keep this going...

    • @veryacademy
      @veryacademy  4 ปีที่แล้ว

      Thanks, will do! 👍

  • @nicocouss7849
    @nicocouss7849 3 ปีที่แล้ว +1

    Really nice serie, thx a lot!

    • @veryacademy
      @veryacademy  3 ปีที่แล้ว

      You're very welcome!

  • @radosawskabania1529
    @radosawskabania1529 3 ปีที่แล้ว

    Great video!

  • @Omar_Thinks
    @Omar_Thinks 3 ปีที่แล้ว +1

    Wonderful video. Thank you! :)

  • @anshuldubey9193
    @anshuldubey9193 3 ปีที่แล้ว +7

    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

    • @user___01
      @user___01 3 ปีที่แล้ว

      this is also my problem @Anshul Dubey do you got an answer or solution to this?

    • @mohmedAhmed-jo3pe
      @mohmedAhmed-jo3pe 2 ปีที่แล้ว

      @@user___01 up

  • @paborlouise319
    @paborlouise319 4 ปีที่แล้ว +1

    Thanks Sir. Great work.

    • @veryacademy
      @veryacademy  4 ปีที่แล้ว +1

      Thank you - any question or issues just let me know.

  • @user___01
    @user___01 3 ปีที่แล้ว +1

    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.

  • @mahmudsajib8648
    @mahmudsajib8648 4 ปีที่แล้ว +1

    Love you for your effort ❤

    • @veryacademy
      @veryacademy  4 ปีที่แล้ว +1

      Thank you so much 😀

  • @KatuninPavel
    @KatuninPavel 3 ปีที่แล้ว +4

    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.

  • @user-dh8dd3pe1i
    @user-dh8dd3pe1i 4 ปีที่แล้ว

    Nice sir keep it up 👍💪💪💪

    • @veryacademy
      @veryacademy  4 ปีที่แล้ว

      Thank you, I will 🐱‍🏍

  • @mr.anderson5393
    @mr.anderson5393 ปีที่แล้ว

    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.

  • @diegobraga2207
    @diegobraga2207 3 ปีที่แล้ว

    your tutorials are the best!! could you make an tutorial how to make I like button in both sides django and react?

  • @eagleofsharm
    @eagleofsharm 3 ปีที่แล้ว

    Golden Inf, THANK YOU

  • @chukwuka-steveorefo1812
    @chukwuka-steveorefo1812 ปีที่แล้ว

    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?

  • @rangabharath4253
    @rangabharath4253 4 ปีที่แล้ว +1

    Awesome

  • @FreeDomSy-nk9ue
    @FreeDomSy-nk9ue 2 ปีที่แล้ว +1

    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...

    • @veryacademy
      @veryacademy  2 ปีที่แล้ว +1

      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.

    • @FreeDomSy-nk9ue
      @FreeDomSy-nk9ue 2 ปีที่แล้ว

      @@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.

  • @gaborlakatos882
    @gaborlakatos882 3 ปีที่แล้ว +3

    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.

    • @veryacademy
      @veryacademy  3 ปีที่แล้ว +1

      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. 👍

  • @igormundim
    @igormundim 2 ปีที่แล้ว

    Aula muito boa!

  • @harshbiyani3048
    @harshbiyani3048 9 หลายเดือนก่อน +1

    Why do we need to Inherit PostUSerWritePermission ? Will mentioning this class as permission_classes won't suffice ?

    • @veryacademy
      @veryacademy  9 หลายเดือนก่อน

      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.

    • @harshbiyani3048
      @harshbiyani3048 9 หลายเดือนก่อน

      @@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

  • @jeraldjoshuaechavia1108
    @jeraldjoshuaechavia1108 3 ปีที่แล้ว +1

    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

    • @veryacademy
      @veryacademy  3 ปีที่แล้ว

      Sounds like there is no data in the database or you are selecting the wrong data in the database?

  • @quizandfun_
    @quizandfun_ ปีที่แล้ว +1

    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?

    • @veryacademy
      @veryacademy  ปีที่แล้ว

      Do me a favor and ask/beg Udemy customer services, I have no control over it.

  • @abdelrhmanahmed1378
    @abdelrhmanahmed1378 3 ปีที่แล้ว

    when we create a post using the post view why it didnot saved in the temporary database ?!

  • @xVeraldi
    @xVeraldi 2 ปีที่แล้ว +1

    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

    • @veryacademy
      @veryacademy  2 ปีที่แล้ว

      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.

  • @aashayamballi
    @aashayamballi 4 ปีที่แล้ว

    Thank you 🙏🏼🙏🏼

    • @veryacademy
      @veryacademy  4 ปีที่แล้ว +1

      You are so welcome 👍

  • @usamashehab9319
    @usamashehab9319 2 ปีที่แล้ว +1

    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

    • @veryacademy
      @veryacademy  2 ปีที่แล้ว +1

      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.

  • @abdelrhmanahmed1378
    @abdelrhmanahmed1378 3 ปีที่แล้ว

    how can we store the author name also in the post model ,so we can retrieve it when we serialize

  • @Pavel-er4hy
    @Pavel-er4hy ปีที่แล้ว

    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...

  • @suavementelucas7351
    @suavementelucas7351 2 ปีที่แล้ว +1

    and if I want to list only the posts of the logged in user?

    • @veryacademy
      @veryacademy  2 ปีที่แล้ว

      You need to create a query for example - Post.object.filter(user=1)

  • @paycation3966
    @paycation3966 8 หลายเดือนก่อน

    15:57 forgot the password, hahaha