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

Поделиться
HTML-код
  • Опубликовано: 4 янв 2025

Комментарии • 66

  • @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 3 года назад

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

  • @SkyIsKingg
    @SkyIsKingg 4 месяца назад +1

    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 6 месяцев назад

    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!

  • @OriginalCodeMaster
    @OriginalCodeMaster 2 года назад

    Gr8 job bro, you deserve more than 20k sub

  • @destroyer6679
    @destroyer6679 3 года назад +1

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

  • @omshukla1211
    @omshukla1211 10 месяцев назад

    Thank you man. It was really helpful

    • @jimshapedcoding
      @jimshapedcoding  9 месяцев назад

      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

  • @fusrusty253
    @fusrusty253 3 года назад +1

    I love this channel!

    • @jimshapedcoding
      @jimshapedcoding  3 года назад

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

  • @rushwansayyed9723
    @rushwansayyed9723 3 года назад +1

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

  • @it-wizard
    @it-wizard 2 года назад

    Bro this is so helpful, thanks!

  • @aayushsingh6646
    @aayushsingh6646 2 года назад +1

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

  • @dineshcuts
    @dineshcuts 3 года назад

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

  • @ahmedsalah7595
    @ahmedsalah7595 2 года назад

    how can I make custom validation on the form ?

  • @rahulverma-hp9ft
    @rahulverma-hp9ft 2 года назад

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

  • @sahilchhugh2974
    @sahilchhugh2974 3 года назад

    You da man ! 💪🏼

  • @jarbouiayoub2177
    @jarbouiayoub2177 3 года назад +1

    I liked your content

  • @kwonkwon7460
    @kwonkwon7460 3 года назад

    so helpful! thanks!

  • @anandhavelp6439
    @anandhavelp6439 2 года назад

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

  • @mista_ia
    @mista_ia 2 года назад +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  2 года назад +1

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

    • @mista_ia
      @mista_ia 2 года назад

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

  • @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 2 года назад

      Wonder the same. Have you figured it out ?

  • @shubhamjani2509
    @shubhamjani2509 2 года назад

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

    • @jimshapedcoding
      @jimshapedcoding  2 года назад

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

  • @aadityasingh3681
    @aadityasingh3681 Год назад

    How to add data from views to custom field

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

  • @xSmHbRtCx
    @xSmHbRtCx 2 года назад

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

  • @techwithrg45
    @techwithrg45 3 года назад +1

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

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

    • @آيةفتحىعبدالعزيز
      @آيةفتحىعبدالعزيز 2 года назад

      @@ZIRRAMA how did you fix this issue?!

  • @رضاخلیلیان-ك8ه
    @رضاخلیلیان-ك8ه 3 года назад

    thanks ,❤❤❤

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

  • @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 :)

  • @fabinhorockfabinho
    @fabinhorockfabinho 3 года назад

    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  3 года назад

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

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

  • @devmrnecro4215
    @devmrnecro4215 3 года назад

    Do a video for django ORM too

  • @dammuparameswari3271
    @dammuparameswari3271 3 года назад

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

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