Django Custom User Model | Example 1 | Multiple User Types | Django AbstractUser

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ก.ย. 2024
  • In this Django tutorial, we learn how to build a Django custom user model. The Django 4.x ORM course provides learners with a complete overview of the Django Framework ORM (Object-relational mapping) through applied learning. In this course, you’ll learn about the features of Django ORM and SQL. By better understanding the features of the Django ORM, you will learn how to interact with databases from within a Django project, as you would with SQL. You will learn how to administrate tables and perform common Create, Return, Update and Delete (CRUD) operations through the Django ORM.
    Udemy Course Link: Django 4.x ORM Mastery
    ===================
    www.udemy.com/...
    TH-cam Playlist
    ===================
    • DJ101 | Django Databas...
    GitHub Code Repository
    ===================
    github.com/ver...

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

  • @andreasbuchmann6915
    @andreasbuchmann6915 ปีที่แล้ว +5

    If you override the save method like this on the Custom User class then you will not be able to update your model instances as the super().save(*args, **kwargs) will never be reached. This line should be moved outside of the if-clause.

  • @psgpyc
    @psgpyc 2 ปีที่แล้ว +13

    Just bought your course on Udemy. Thank you for all the hard work you have put into the course. This is my way of thanking you for all the amazing content on youtube .

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

      Thanks Paritosh, much appreciated. I only really feel I have just started and the best is still to come.

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

      Cloud you please share Link of the course

  • @xxoooOFxx
    @xxoooOFxx 5 หลายเดือนก่อน +3

    Your willingness and courage to be nuanced (not talk too much) in a space that's filled with 'learn this in 5 minutes' is what helped me get to the bottom of Django. Don't ever stop 'talking too much'!

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

    Nice tutorial however I’m not so comfortable changing the built-in user model to add the role field; I think that’s a best practice…to not update the built-in tables. I also feel a bit like this conflates the meaning of user types with user roles. A user type to me is different. You may have users of the same types with different roles. For example if you’re building a crm tool and you may have and admin vs regular user role. Or even in Django itself, the user can be admin or staff. I guess we could just rename your “role” field to user-type or build another user type table, and use a separate table to track roles

  • @michaelseth4954
    @michaelseth4954 2 ปีที่แล้ว +10

    You are no doubt one of the best teachers on the internet. I really love the way you take out time to explain each concept in your videos.
    What playlist is this video listed in?
    I've been searching through your channel and I can't find it in any playlist.
    Can you please pin a roadmap video from complete beginner to advance mastery.
    Thanks 👍🏼

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

    I'm amazed by the depth of the subject you"re willing to teach every time one of your video pop up. It's well above most of the "Tuto" you can find on youtube.
    Please continue going that way and thank you for you're work .

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

    To me, I prefer to use the approach of groups because it will be easier to me to handle the multiple user types. For example, Teacher group will accept only the teachers and Student group will accept only the students and so on.

  • @wassimsghaier-kq3xf
    @wassimsghaier-kq3xf 5 หลายเดือนก่อน

    how to add signup and login for them and how to do it with rest api framework

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

    Thanks alot for your well-described tutorials. There's a question I've been meaning to ask, not necessarily about Django alone, but on a general codebase level. It goes thus:
    Using this process as an example, say I want to start a project with a custom Userbase by inheriting and customizing the AbstractUserModel. There are certain behaviors and functionalities that my custom user class will have to exhibit. Such as the 'normalizing the email' step, for the email field.
    Do I always have to know the code and steps taken to implement these functionalities, or is there room to refer to official documentation if the need arises?

  • @MuhammadSaad-kb7op
    @MuhammadSaad-kb7op ปีที่แล้ว +1

    This course video lecture is very helpful. Would it be possible for you to create a video showing the login and signup pages for multiple user types.

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

    Did you ever make the next one?

  • @lolpunch9391
    @lolpunch9391 10 หลายเดือนก่อน +1

    Perfect video, That's what I'm looking for, keep up

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

    Sir my question is how to define different fields,
    for example for students we may have 4 fields,
    name, fname, address, contact,
    and for teachers we may have 6 or 7 fields,
    now how to define these fields in one model ??

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

      You simple don’t unless your happy with lots of null data. If your happy with having one table just use abstractuser and add the extra fields

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

      Create a profile model with extra fields and a one-to-one field that refers to the user model (abstract teacher model)

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

    I am looking for a continuation video on DRF. Your tutorials are fantastic and simplified

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

    is Example 2 in Udemy?

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

      Sorry no I haven’t finished it yet.

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

      @@veryacademy when Example 2 may come sir?

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

    You are the best teacher I've ever had, your videos are dope. Keep it up!
    I'm implementing multipe user types and I like the idea of having OneToOne and proxy models but my boss told to use groups and object level permissions with django guardian, does it make sense? Which one is more feasible. Advantages and disadvantages?

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

      We are talking about 3 different subjects here. Proxy model gives you added convenience when querying, one to one profile table for when you need to store data about specific user types and to help avoid null data and always permissions for authorisation. Nothing to compare here.

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

    i wait for this. Thanks

  • @evelyndezsi3975
    @evelyndezsi3975 6 หลายเดือนก่อน +1

    Very good explained and was a life saver

  • @yrHtHDUmkal
    @yrHtHDUmkal 15 วันที่ผ่านมา

    Thank you mate

  • @my-trending
    @my-trending 6 หลายเดือนก่อน

    Thank you very much for this tutorial. Please when is the other two example tutorials coming out?

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

    This topic is very important and useful for me right now. I am doing my college project in django.
    If possible, I want to make a request. How about if wanted to authenticate different users with different methods? Like login Teacher with email and Students with roll number or phone number?

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

    Why did you create the user app? Like, why it is called user and not like a home page or something else?

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

    thanks for the explanation!
    I wanted to ask you how I could then implement a registration, login and logout system for each type of user, to connect to a flutter app

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

    Nice topic, please do more advanced topic for future videos so you're able to different from other django youtuber, I programing from django 1.5 so i think i know somethings so i have to say, you have master degree at django sir. 🤙

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

    5th Sept 2023 - This has really helped me understand the AbstractUser as I've been really trying to grasp it. Thanks !!!

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

    Sir, we need to create a custom manager if we inherit AbstractBaseUser, and not need to write a custom manager if we inherit AbstactUser only. am i right?

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

    Can you please share the next tutorial you are referring to?

  • @aliakeemmhlanga4576
    @aliakeemmhlanga4576 2 หลายเดือนก่อน

    Did the "next" tutorial ever come?

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

      No I did not follow this up directly.

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

    Showing how to override the save method on abstractuser saved me so much pain. Thank you for this top notch tutorial!

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

    🐱This is one of the best teaching of Django admin modules. I'm beyond happy to watch your channel and demonstration🐱 Really appreciate!

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

    How is this course different from the previous Django orm course? And is the previous one a prerequisite for this course?

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

    Xander please make a detailed video about testing signals. There is no tutorial about it!

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

    Sir , django 4.1 is released.
    Please make video on 4.1
    Thankyou

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

    Thank you for a great tutorial ,is there any way we can add a uuid field as a primary key and still save the user to the database

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

    This was a great video and detailed. i really appreciate your dedication to teaching 😊

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

    Thank you very much, your tutorials are very good and helpful.

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

    Another student learning a lot with your videos, I enjoy your good natured tone and teaching pace. Thank you!

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

    Hey, I can't find the tutorial that follows this one, and this video isn't even in the playlist mentioned in the description.

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

      Sorry I stopped because I didn’t like the quality of the previous. I am in process of updating these ORM tutorials

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

    i always learn new details that i rarely see anywhere from you. thanks

  • @developer-pf2fl
    @developer-pf2fl ปีที่แล้ว

    Amazing Tutorial ! God bless You

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

    When is the next tutorial ? Good work !

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

    Thank you for your tutorials.

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

      No problem, more coming on this soon.

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

    🚀🚀Awesome zander, Thnaks.!

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

    Please include OpenID authentication

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

    Thanks a lot!! The tutorials are very useful!

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

    Sir how to update this tables

  • @bouchrasaidi2202
    @bouchrasaidi2202 6 หลายเดือนก่อน

    Thank you so much !!!

  • @Max-s6x
    @Max-s6x 2 ปีที่แล้ว

    Next course on DRF?🙂

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

    thanks

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

    The signals part is super interesting. I was bothered by the idea of filling tables multiple times, one time for the user another for the user profile. But what if the fields in the user profile are mandatory, will it still work?

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

      Hi. Yes, that isn't a problem. I have made the assumption that we would create our own sign-up forms, that would simply be a mandatory field in our form. I will show a full example in upcoming tutorials. Next up, a little about AbstractBaseUser where we can customise the whole experience. By doing that we customise the signup process. That is where it gets a little more exciting. Once I take you through that, we move on to user type example 2. Here in example 2 we will customise the authentication process, integrate everything in to handle multiple users and set up a dynamic signup form. It keeps going, I will show how to create groups and assign uses to those groups on signup, we could then do an example with DRF! As always let me know if you would like to see something I have not mentioned

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

      @@veryacademy You are just a blessing to this generation, thanks for all you do man

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

      @@veryacademy Waiting for this continuation..., I have purchased your Udemy course after seeing how amazing your tutorials are.

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

      When?@@veryacademy

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

    I thought I had seen the best Django tutorials on TH-cam, because I've been at it for quite some time now. Boy was I wrong!
    I no longer have words suitable to describe how appreciative I am of tutorials like yours. I saw your channel mentioned by another learner in the comments of some other great video, so I decided to check it out. One of my greatest decisions all year.

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

    Excelente, mesmo não entendendo muito bem a sua língua e utilizando a legenda pra me auxiliar, consegui compreender tudo! A parte teórica do início do vídeo foi um verdadeiro mapa da aula e você reproduziu com maestria no código exatamente tudo que se propôs a fazer.