Learn Django - Class-Based Permission Checks

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ม.ค. 2025

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

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

    Great tip on setting up redirects to 404 for security, definitely goes into my app

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

      Glad it was helpful!

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

    perfect - thanks for making this and the CBV series :) here's to 20 21!

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

    your content is great the best and most professional django source on youtube

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

      Thanks David, it’s a shame really. I’m not saying my content is good, but I just hope it’s better than any paid content. Don’t pay for learning - just ask if you need anything

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

    Thanks a lot, you have saved my day, now I need permission according to field value.

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

    another amazing tutorial, excellent work Zander!

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

    Great. Another one I've been waiting for. I haven't seen this in any other django series on TH-cam.

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

      Pabor, and the best thing is - we have barely started! I can think of another 100 tutorials! I can hardly believe it myself how little Django content is out there! Even worse people pay for it! As per normal just ask if you need or would like to see anything. The blog series. I think I have got to that point I need to refactor the code and tidy up so we can move it to the next level. I will spend time tidying the code then will do the deploy.

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

      @@veryacademy one thing you can add to the Blog series is file upload validators(jpg,jpeg,png)that prevents users from uploading wrong files. There's a ton of things Django is apparently used for, and just a few on TH-cam. Django is the best thing that happened to Python.

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

      Sure, I did give a preview or small example in the first video of the image api series. But, like you said so much more can be done. I will build a whole tutorial on it.

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

      @@paborlouise319 can't agree more! especially in web development field 👏🏽

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

    Thank you boss.... time 23:34==>> How to "Quick Fix"?...What extensions did you use?

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

    really good tutorial

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

    Thank you so much for this very valuable content indeed !!

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

    Hi, thanks a lot for this video! I have a question, we saw how to restrict edit access to a group of users to a certain model. But what if we want to restrict edit access within that model to only the entries that the single user has inserted previously (so each user can only edit their own entries)? Right know if I'm user A and I'm in the same group as user B, I can still access the edit URL and change user B's entries as we are in the same group. Thanks!

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

      Why not adding user id when inserting...

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

    this video is the video to understand how to work with generic views with access control management .

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

    very helpful, keep up the good work

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

      Glad it helped, thank you and have a good day

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

    Thanks zander !!
    One question though , can't we use the @permission_required function decorator in corporate with method decorator over class or dispatch()

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

    Is it considered unsafe to put stuff like {% if user.is_authenticated %} and {% if user.has_permission %} etc. in the template to show/hide things that should/shouldn't be seen?

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

      Used correctly, it poses little threat. Remember that this is processed at the back end.

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

      @@veryacademy cool, thanks for the reply. Your channel has been the most valuable to me by far when it comes to learning Django piece by piece :)

  • @زيادالعتيبي-ط6د
    @زيادالعتيبي-ط6د 4 ปีที่แล้ว +2

    this is really great, i'm pritty good at django rest framework but i need to be better what do you think i can do to improve my?

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

    800 mark! Going good 👍🏼

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

      Only another 999200 to go ;) - just recording the React Chatroom with Django back-end + deploying on Heroku - be up in about 2 hours

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

      @@veryacademy haha! Very soon very soon 🤓... And will be waiting for the other one. Thanks🙏🏼

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

      @@veryacademy Not an issue, we can wait and please take care.

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

    Hi! can you explain me why you have two put UserAccessMixin and "self" insed the super()? I guess that this is to reference the class you inherit from, right? But with that super() where are you pointing at to?

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

      after some investigation a found the answer. Thanks anyway!

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

    Thank you a lot

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

    Hi , I used UserAcessMixin , and how when im starting ReactJS - frontend part , I want to make API calls , but I got error too : ,,many redirection,, known as ,,redirection loop,,. I think that problem is in redirect_field_name with value of next, bcs I see that in console mentiond. Does anyone have solution to this or just to point me to right direction. Thank you

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

    Nice !

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

    Very nice.. but why "books.change_books"? I suppose is the model name, but I try here, it doesn't work... chat gpt says that it is needed the app name, and permission.. Could you elaborate on that? THanx

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

    I'm I right in thinking that the custom mixin removes the need to use the LoginRequiredMixin?

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

      Sorry - I cant remember what is in this tutorial - but you can indeed create a custom mixin to do that.

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

    It seems the repo on github is not updated to include the UpdateView (BookEditView) nor the PermissionRequiredMixin (UserAccessMixin). Could you please upload them? Great series otherwise, it's exactly what I was hoping to find!

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

      Hi Anthony, I am really sorry about this!

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

    PERFECT PERFECT PERFECT

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

    Does this work with an all-auth based login system?

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

      You can use permissions along side all-auth

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

    Thanks!

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

    This is really awesome, but is there a way to change the permissions of the groups in the code and not the admin panel

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

      See if this is useful cheat.readthedocs.io/en/latest/django/permissions.html

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

    Great video
    What extension are you using for the python intellisense

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

      Just called Python and Django

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

    How to restrict django user to edit others user post ?

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

      You could simply add in the model the author of the post. Then you could match the user to the post so that only the owner of the post can edit.

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

      @@veryacademy how to add in model? Can please you give any link or tutorial?

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

    A+

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

    If you're familiar with django, make views as functions, it's simpler and more practical.