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

Поділитися
Вставка
  • Опубліковано 7 лис 2024

КОМЕНТАРІ • 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 2 роки тому

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

  • @imSky69
    @imSky69 2 місяці тому +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 4 місяці тому

    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!

  • @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❤️🙌

  • @rushwansayyed9723
    @rushwansayyed9723 2 роки тому +1

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

  • @destroyer6679
    @destroyer6679 3 роки тому +1

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

  • @fusrusty253
    @fusrusty253 3 роки тому +1

    I love this channel!

    • @jimshapedcoding
      @jimshapedcoding  3 роки тому

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

  • @OriginalCodeMaster
    @OriginalCodeMaster Рік тому

    Gr8 job bro, you deserve more than 20k sub

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

  • @techwithrg45
    @techwithrg45 3 роки тому +1

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

  • @omshukla1211
    @omshukla1211 8 місяців тому

    Thank you man. It was really helpful

    • @jimshapedcoding
      @jimshapedcoding  7 місяців тому

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

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

  • @it-wizard
    @it-wizard 2 роки тому

    Bro this is so helpful, thanks!

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

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

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

  • @aayushsingh6646
    @aayushsingh6646 2 роки тому +1

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

  • @jarbouiayoub2177
    @jarbouiayoub2177 3 роки тому +1

    I liked your content

  • @sahilchhugh2974
    @sahilchhugh2974 3 роки тому

    You da man ! 💪🏼

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

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

  • @ahmedsalah7595
    @ahmedsalah7595 2 роки тому

    how can I make custom validation on the form ?

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

  • @kwonkwon7460
    @kwonkwon7460 3 роки тому

    so helpful! thanks!

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

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

  • @rahulverma-hp9ft
    @rahulverma-hp9ft 2 роки тому

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

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

  • @aadityasingh3681
    @aadityasingh3681 Рік тому

    How to add data from views to custom field

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

  • @anandhavelp6439
    @anandhavelp6439 2 роки тому

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

  • @رضاخلیلیان-ك8ه
    @رضاخلیلیان-ك8ه 2 роки тому

    thanks ,❤❤❤

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