Learn Django - Class-Based Permission Checks

  Рет қаралды 25,354

Very Academy

Very Academy

Күн бұрын

Learn Django Class-Based Views through a series of small Django tutorials introducing Class-Based Views starting with providing you an introduction to the generic built in Django views. Here in this tutorial we take a look at Class-based permission checks, applying permission checks to class-based views with the PermissionRequiredMixin. In this tutorial we Review Permissions and Authorisation, configure permission groups, look at the PermissionRequiredMixin (apply permission checks) and finally, develop and deploy a custom Mixin.
00:00 Introduction
Need help downloading and starting the code?
=================================================
Tutorial - How to download and run the code (must have Python installed)
• Building a Simple Blog...
=================================================
Code Repository
github.com/veryacademy/YT-Dja...
SUBSCRIBE to get more free tutorials, courses and code snippets!
/ @veryacademy
Follow us on Facebook
/ veryacademycom-1132321...
Follow use on Twitter:
/ veryacademy

Пікірлер: 58
@rossgeography
@rossgeography 3 жыл бұрын
perfect - thanks for making this and the CBV series :) here's to 20 21!
@spreadhysteria3650
@spreadhysteria3650 3 жыл бұрын
Thanks a lot, you have saved my day, now I need permission according to field value.
@steliosioannides7128
@steliosioannides7128 2 жыл бұрын
Thank you so much for this very valuable content indeed !!
@paborlouise319
@paborlouise319 3 жыл бұрын
Great. Another one I've been waiting for. I haven't seen this in any other django series on KZfaq.
@veryacademy
@veryacademy 3 жыл бұрын
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 3 жыл бұрын
@@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 KZfaq. Django is the best thing that happened to Python.
@veryacademy
@veryacademy 3 жыл бұрын
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 3 жыл бұрын
@@paborlouise319 can't agree more! especially in web development field 👏🏽
@afaf6478
@afaf6478 3 жыл бұрын
Great tip on setting up redirects to 404 for security, definitely goes into my app
@veryacademy
@veryacademy 3 жыл бұрын
Glad it was helpful!
@davidrosen2705
@davidrosen2705 3 жыл бұрын
your content is great the best and most professional django source on youtube
@veryacademy
@veryacademy 3 жыл бұрын
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
@FitriWibowo
@FitriWibowo 3 жыл бұрын
very helpful, keep up the good work
@veryacademy
@veryacademy 3 жыл бұрын
Glad it helped, thank you and have a good day
@janirico5641
@janirico5641 Жыл бұрын
another amazing tutorial, excellent work Zander!
@prateeksarangi9187
@prateeksarangi9187 2 жыл бұрын
Thanks zander !! One question though , can't we use the @permission_required function decorator in corporate with method decorator over class or dispatch()
@davitkvaratskhelia4033
@davitkvaratskhelia4033 2 жыл бұрын
Nice !
@zorojuro5106
@zorojuro5106 3 жыл бұрын
really good tutorial
@veryacademy
@veryacademy 3 жыл бұрын
Glad you think so!
@thefutureofslimeandvines7315
@thefutureofslimeandvines7315 3 жыл бұрын
Thank you a lot
@veryacademy
@veryacademy 3 жыл бұрын
Glad it helped
@KevinTempelx
@KevinTempelx 3 жыл бұрын
Thanks!
@veryacademy
@veryacademy 3 жыл бұрын
Welcome!
@muhammedrahil5780
@muhammedrahil5780 Жыл бұрын
PERFECT PERFECT PERFECT
@AndreBeeDXB
@AndreBeeDXB 3 жыл бұрын
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...
@yousefiazkco1440
@yousefiazkco1440 Жыл бұрын
Thank you boss.... time 23:34==>> How to "Quick Fix"?...What extensions did you use?
@aashayamballi
@aashayamballi 3 жыл бұрын
800 mark! Going good 👍🏼
@veryacademy
@veryacademy 3 жыл бұрын
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 3 жыл бұрын
@@veryacademy haha! Very soon very soon 🤓... And will be waiting for the other one. Thanks🙏🏼
@aashayamballi
@aashayamballi 3 жыл бұрын
@@veryacademy Not an issue, we can wait and please take care.
@zosutosu
@zosutosu Жыл бұрын
this video is the video to understand how to work with generic views with access control management .
@user-yx8yg1kc3d
@user-yx8yg1kc3d 3 жыл бұрын
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?
@veryacademy
@veryacademy 3 жыл бұрын
Just keep reading and building seems like the only way
@user-yx8yg1kc3d
@user-yx8yg1kc3d 3 жыл бұрын
@@veryacademy yeah that’s what I’m doing
@ThukuWakogi
@ThukuWakogi 3 жыл бұрын
Great video What extension are you using for the python intellisense
@veryacademy
@veryacademy 3 жыл бұрын
Just called Python and Django
@iloveraplot
@iloveraplot Жыл бұрын
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
@marif5103
@marif5103 3 жыл бұрын
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 3 жыл бұрын
See if this is useful cheat.readthedocs.io/en/latest/django/permissions.html
@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!
@anthonymalkoun6188
@anthonymalkoun6188 3 жыл бұрын
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 3 жыл бұрын
Hi Anthony, I am really sorry about this!
@chyldstudios
@chyldstudios 3 жыл бұрын
A+
@rafaeldiasmartins4369
@rafaeldiasmartins4369 5 ай бұрын
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 жыл бұрын
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.
@MatHEWStorm
@MatHEWStorm Жыл бұрын
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 Жыл бұрын
Used correctly, it poses little threat. Remember that this is processed at the back end.
@MatHEWStorm
@MatHEWStorm Жыл бұрын
@@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 :)
@holthuizenoemoet591
@holthuizenoemoet591 2 жыл бұрын
Does this work with an all-auth based login system?
@veryacademy
@veryacademy 2 жыл бұрын
You can use permissions along side all-auth
@FarhanAhmed1360
@FarhanAhmed1360 3 жыл бұрын
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?
@cleitondelima
@cleitondelima 2 жыл бұрын
If you're familiar with django, make views as functions, it's simpler and more practical.
Django Permissions | Model Level | Views and Templates
23:30
Very Academy
Рет қаралды 16 М.
어른의 힘으로만 할 수 있는 버블티 마시는법
00:15
진영민yeongmin
Рет қаралды 9 МЛН
Chips evolution !! 😔😔
00:23
Tibo InShape
Рет қаралды 42 МЛН
СҰЛТАН СҮЛЕЙМАНДАР | bayGUYS
24:46
bayGUYS
Рет қаралды 770 М.
Learn Django Class Based Views - DetailView - Theory and Examples
26:15
Multiple User Types | Django
21:13
Daniel Roy Greenfeld
Рет қаралды 54 М.
The gist of the the custom user model in Django
10:17
Django road
Рет қаралды 5 М.
Learn Django Class Based Views - ListView - Theory and Examples
21:59
어른의 힘으로만 할 수 있는 버블티 마시는법
00:15
진영민yeongmin
Рет қаралды 9 МЛН