Python Django - How to add custom fields to the User Model ?

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

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

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

    More intermediate Django tutorials to come!
    You can help me down below by sharing your ideas what to cover🔥

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

      Maybe you should make a video about deployment and security of our websites, thx for your work

  • @imSky69
    @imSky69 3 วันที่ผ่านมา

    love ur way of explanation , and you hit the spot man , keep it up u deserve the best

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

    You are the best bro. Thanks for this. I tried using "add_fields", "fields" and "list_display" but none of them worked. I was very frustrated untill I found your video and it helped me in the exact way I wanted. Thanks very much.

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

      Hello! You are very welcome and I am happy this could help you out

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

    Great video!! saved me a lot of time. Exactly what I needed

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

    Ohhh thank you men, nice to see good videos about Django.

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

      You are welcome. Feel free to share with friends that love to code!

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

    I love this channel!

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

      The channel loves you back :)
      Glad you enjoy my content

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

    You are Amazing Coder Thanks For Help Thanks Very very Much...!!!

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

    Gr8 job bro, you deserve more than 20k sub

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

      Yeh people say that a lot 😂 thanks bro!

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

    Thanku so much bro. It actually help me lot. ♥️

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

    Thannks a lot brother.. searching 2 days in stack overflow,youtubes to solve my solution.. finally found a video that could help me❤️🙌

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

    I liked your content

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

    Thank you man. It was really helpful

    • @jimshapedcoding
      @jimshapedcoding  4 หลายเดือนก่อน

      You're welcome! Hope you'll watch more of my videos as well

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

    I was looking for this exact scenario, Thank you.

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

      Perfect, it's a common situation in Django that you want to know how to handle for sure. Glad it helped you out!

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

      @@jimshapedcoding but i tried to implement this in my views by including the extra field in my form it was not added, any thoughts? Tnx

  • @it-wizard
    @it-wizard 2 ปีที่แล้ว

    Bro this is so helpful, thanks!

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

    You da man ! 💪🏼

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

    Sir pls we want some more django courses
    After finishing python OOP pls consider making a big django course

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

    How can we display the custom fields value in the templates?

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

    so helpful! thanks!

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

    how can I make custom validation on the form ?

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

    How to add data from views to custom field

  • @rahulverma-hp9ft
    @rahulverma-hp9ft 2 ปีที่แล้ว

    how to override the singup page with this extended user model(Account)

  • @user-fk5vs9se3z
    @user-fk5vs9se3z 2 ปีที่แล้ว

    thanks ,❤❤❤

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

    Hi Jim! Quick question: When I create other Models and want to reference the User/Account model as a foreign key, what/how should I reference the correct model?

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

      Wonder the same. Have you figured it out ?

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

    Bro, Could you tell me that How to store value to the extended fields through Views.py file

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

    Do a video for django ORM too

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

    thank you this was really helpful, how would i create model forms based on this ?

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

      Glad it helped!
      I also have tutorials how to create the models :)

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

    Sir show a video how to create a django project in pycharm without using virtual environment..

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

    Nice Tips to make user profile model!
    I ve done a custom user by overriding from AbstractBaseUser and PermissionsMixins, all works fine, meant first migrations and altering db_table_name.
    But when I tried to add fields like gender, python makemigrations see No changes, any idea?

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

      Thanks!
      Maybe worth to check it is still written inside the INSTALLED_APPS in the settings.py ?

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

      @@jimshapedcoding thanks for that... my bad, I wasn't seeing that I left a trailing comma which makes it tuple!

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

    Thank you Jim. I was looking for this. It helped me to fix my problems. Can we use ckeditor in admin page?

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

    Hey Jim, very appreciate for making this video, it dose help me a lot! One question : The strategy you use here is to create a new model "Account" and make a relationship to exist model "User", am I right ?

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

      Hey! Yes exactly. I am very glad you enjoyed the video :)

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

    This was nice, thanks! How can I now make a registeration form that forces the new user to add bd and gender while creating new user?

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

      Thanks a lot. There are multiple ways to force users to add those pieces of info.
      1) You have to use an input field in the HTML that will be configured as if this field is empty, then it will raise a warning after submitting the form (Almost all the forms in bootstrap configured in that way for username/password)
      2) You can use django forms and write a validation for each form.

  • @JJ-ot3ps
    @JJ-ot3ps 2 ปีที่แล้ว

    Hi Jim, great video! I am just wondering as I am building an e-commerce site, is Django a good choice for python, since I am only comfortable with python at this point? or should I switch to Java?

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

      Hi, thanks!
      I think Django is a wonderful option to go with. Good luck

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

    Hello dear JimShapedCoding. I followed your tutorial (it's awesome) but faced with a strange issue. The Account model is always blank while new users are being added. Users have the added fields but as I said Accounts section on django admin is always blank. How do I fix it? Thanks in advance and have a nice day!

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

      Thanks a lot, can you share maybe the code on discord channel ? Maybe it's just a matter of some model name that needs to be fixed :) Thanks for following along my videos!!

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

      @@jimshapedcoding Thank you so much I did fix the issue. Didn't figure out what was the actual mistake but who cares it works lol

    • @user-ll4nl9cv2z
      @user-ll4nl9cv2z 2 ปีที่แล้ว

      @@ZIRRAMA how did you fix this issue?!

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

    Hello jimshapedcoding I've got a question. Is it possible to have one Django project with two apps and both having it's own user model for authentication?

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

      Hey Kelvin, thanks for raising the question on our Discord community, hope you found there my opinion about it :)

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

      @@jimshapedcoding for those who don’t have discord, what was your opinion?

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

    It had better if you make advanced videos about django . Because tutorials on youtube are usually for beginners .

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

      Definitely that's what I said on my introduction :), this video is just the beginning. So chances are high that you are familiar with what I have done here, still, an important topic I don't see covered on each course.

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

    Thanks, It help me a lot! I have a question: If I wanna creating a user registration form using this fields, how would I do it?

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

      No problem at all! You can watch my Django tutorial on my channel as I explain this :)