Custom User Registration Django (AbstractBaseUser and UserCreationForm)

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ม.ค. 2025

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

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

    genuinely the best django videos I've been able to find. Love when you stop to explain the small stuff that you think people might have a hard time following. Great videos

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

    Love when the author stop to explain the small stuff, like the if POST expression, where the error_text came from, ... Make the tutorial easy to follow.

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

    Mitch you're love! thumbs up for such a high quality videos :)

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

    Do you need to specify the emailField at 1:40 if you include 'email' in the fields inside Meta?

  • @munishrana1985
    @munishrana1985 4 ปีที่แล้ว

    Best Video Tutorial I have ever got thanks a lot

  • @vidzones
    @vidzones 4 ปีที่แล้ว

    getting long texts of [Your password can't be too similar to your other personal information.Your password must contain at least 8 characters.Your password can't be a commonly used password.Your password can't be entirely numeric.] after password field at 13:43.

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

    Unfortunatly on this one got stuck, just trying to chek in on that log in form looks and i get error:TemplateSyntaxError at /register/
    Invalid block tag on line 27: 'endblock', expected 'endblock' or 'endblock Content'. Did you forget to register or load this tag?
    {% endblock content %}
    had issues before but mainly was typo issues but this one just is not making sense, ran true all code all identical, I am lost!

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

    Hey, I'm getting this weird error manager isn't available. Manager isn't available; 'auth.User' has been swapped for 'users.User'
    (user is the name of my app which is related to my users) and I have no idea what to do. I'm clueless. Any help

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

      did you solve

    • @piyush6631
      @piyush6631 4 ปีที่แล้ว

      @@omergolcu4838 Yea I solved but I'm not doing Django anymore lol I'm studying a little bit about front end and css now

    • @sanju7877
      @sanju7877 4 ปีที่แล้ว

      @@piyush6631 can you tell us how you solve it
      I got the same problem Reply ASAP

    • @1-60-stories
      @1-60-stories 4 ปีที่แล้ว

      did this dude really not share the solution?

    • @1-60-stories
      @1-60-stories 4 ปีที่แล้ว

      Update for that, In my case I forgot to indent the "Meta" class in forms.py which caused this error

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

    awesome video series. Thank you for teaching us for free!
    But i have one problem. How and where is checked if passwordw1 and password2 are equal?

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

    It is posible add style to password and password validation input?

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

    can anybody answer my doubt how could the render statement work when it is outside the esle statement

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

    great videos man but I followed it to the T, and it creates the account, but throws the following error:
    'AnonymousUser' object has no attribute '_meta'

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

      replace the account=authenticate line in views.py with this:
      account = form.save()

    • @amanmishra-vt8hk
      @amanmishra-vt8hk 3 ปีที่แล้ว

      @@arjunmurali1993 authenticate method is returning None, even the email and password are correct and I have mentioned this in settings.py also:AUTHENTICATION_BACKENDS = (
      'django.contrib.auth.backends.ModelBackend',
      )
      What is the reason? Why I am not able to authenticate?

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

    Help text is not showing in the form. Can anyone help?

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

      I got my mistake, I accidentally wrote error in place of field.help_text

  • @ThePassportPapi
    @ThePassportPapi 4 ปีที่แล้ว

    also, how do I add a photo to be required during user registration?

  • @nazimfirdousali6952
    @nazimfirdousali6952 4 ปีที่แล้ว

    If i want to remove username from the registration what i do?

  • @venumadhav7321
    @venumadhav7321 4 ปีที่แล้ว

    i am getting 'TemplateDoesNotExist at /register/' error, couldn't find any solution for this,please help

    • @venumadhav7321
      @venumadhav7321 4 ปีที่แล้ว

      this can be resolved by creating a template folder in account folder and then again creating an account folder in that template folder then add the register.html file in this account folder(the one which is newly created)

  • @xtiandyc7034
    @xtiandyc7034 4 ปีที่แล้ว

    can you convert the registration_view function to a CLASS BASED VIEW? I'm really desperate on this one...

  • @eneko4562
    @eneko4562 5 ปีที่แล้ว

    Could I change the language for example ,to spanish ,of all those help messages if I wanted?

    • @dobrytroll
      @dobrytroll 5 ปีที่แล้ว

      Sure you can. You can change whole project language to spanish in settings.py file

  • @diagknowstech
    @diagknowstech 4 ปีที่แล้ว

    how to add is staff upon registration

  • @emo10001
    @emo10001 5 ปีที่แล้ว

    Hey Mitch. Great videos so far! Thanks so much! I would like users to have to enter in their email twice for validation, like the password1 and password2 fields. Can this be done on this form as well?

  • @techyguys4394
    @techyguys4394 4 ปีที่แล้ว

    I cant add my own fields like mobile number in registration form using this way right??

    • @nazimfirdousali6952
      @nazimfirdousali6952 4 ปีที่แล้ว

      You get solution or not because i am still facing this problem...

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

      @@nazimfirdousali6952 yes I created another model and mapped it one to one with this model and then show forms from both these models while registering

    • @nazimfirdousali6952
      @nazimfirdousali6952 4 ปีที่แล้ว

      @@aryankhandelwal37 Please email me on nazim.mandviwala98@gmail.com

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

      @@aryankhandelwal37 I tried mapping it but keeps giving errors? mind sharing a screenshot of how you did it?

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

      @@abdullahzd7074 Hey I don't even remember ki kis project m ye doubt aya tha mujhe

  • @badmanrko2386
    @badmanrko2386 5 ปีที่แล้ว

    I got the error in the end of this video. please help! The view account.views.registration_view didn't return an HttpResponse object. It returned None instead.

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

      compare your code with mine on github. You forgot something.

    • @shumiraisibanda9180
      @shumiraisibanda9180 17 วันที่ผ่านมา

      @@codingwithmitch looks the same word for word but stilll shows same error

  • @jafaghalemya6177
    @jafaghalemya6177 5 ปีที่แล้ว

    What if error "no such table: account_account" afrer runserver?

  • @tech4028
    @tech4028 4 ปีที่แล้ว

    context['registration_form'], I don't get this? Is there anyone who could explain that to me?

    • @nooruldeenq.5037
      @nooruldeenq.5037 4 ปีที่แล้ว

      a dictionary of python , he put the key ('registration_form') to the (context dic.) with the (value form) , you can use context = {'registration_form': form} at the end of def , instead of using it from the begging, dive with the dictionaries of python it really helps

    • @tech4028
      @tech4028 4 ปีที่แล้ว

      @@nooruldeenq.5037 thanks!

  • @nazimfirdousali6952
    @nazimfirdousali6952 4 ปีที่แล้ว

    When ever i register the new account user automatically login. What is this matter?

    • @safiullahkhansherzad7214
      @safiullahkhansherzad7214 4 ปีที่แล้ว

      this is because the following part of the code in views.py
      username = form.cleaned_date['username']
      password = form.cleaned_date['password1']
      user = authenticate(username=username, password=password)
      login(request, user)

  • @amanmishra-vt8hk
    @amanmishra-vt8hk 3 ปีที่แล้ว

    authenticate method is returning None even the email and password are correct and I have mentioned this in settings.py also:AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
    )
    What is the reason? Why I am not able to authenticate?

  • @venumadhav7321
    @venumadhav7321 4 ปีที่แล้ว

    i am getting CSRF verification failed error ,anyone help please

  • @tech4028
    @tech4028 4 ปีที่แล้ว

    amazing.

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

    It creates the account, but throws the following error:
    'AnonymousUser' object has no attribute '_meta'
    Thank you, your videos have been helping me a lot

    • @i-am-learning-life
      @i-am-learning-life 5 ปีที่แล้ว

      did you solve that ??

    • @ThePassportPapi
      @ThePassportPapi 4 ปีที่แล้ว

      i'm getting the same one shit

    • @rajbaldania2323
      @rajbaldania2323 4 ปีที่แล้ว

      did u got solution because me and others also having same error at registration phasse

    • @rajbaldania2323
      @rajbaldania2323 4 ปีที่แล้ว

      @@ThePassportPapi delete or comment:- account = authenticate(email=email, password=raw_password)
      and write this :- account = form.save()
      le me know if it solves

  • @KevinTempelx
    @KevinTempelx 4 ปีที่แล้ว

    Thanks!

  • @erickramones2167
    @erickramones2167 5 ปีที่แล้ว

    have you consider doing hacking tutorials? that would awesome

  • @veronicagomes2699
    @veronicagomes2699 4 ปีที่แล้ว

    My data from the registration form is no being saved in the database, i checked the code, and i cant find any mistakes

  • @somyaagarwal9498
    @somyaagarwal9498 4 ปีที่แล้ว

    how can i add fields like firstname and lastname to the registration form. Can anyone please help