0

I an going to build a custom django user and a custom log in and sign up views and I want to know if the I should build a custom password reset view as well.

1 Answer 1

1

From the documentation:

If you’re entirely happy with Django’s User model, but you want to add some additional profile information, you could subclass django.contrib.auth.models.AbstractUser and add your custom profile fields

What this means is that an AbstractUser will inherit all functions that can be applied to the User model, so I believe that, as long as you didn't remove password-related fields, the ResetPasswordView will work.

Another way to look at this is through authentication views. If your custom AbstractUser model can get by the default login/signup auth views (even changes through the admin dashboard), I don't see any problem why your model can't take PasswordReserView.

I've done this multiple times. Although I've never reset my user's password, I can guarantee the default views will work as long as you don't modify your username, email, and password fields (you can try, but that may ruin things)

Sign up to request clarification or add additional context in comments.

3 Comments

What I am going to do in the custom user model is that I am going to reset the USERNAME_FIELD to be an email EmailField() and the username will be a normal CharField() I will call it full_name as well, will the built in password reset views work with this ?? Thanks for your help @crimsonpython24
please reply man I have a deadline for the project and I want to start creating the new user model, I do not want mess up the database and the whole code with a malfunctioning model.
I was away for a pickup game so I wasn't in front of my screen. For your question, you can refer to this thread on how to override the views. Since you already modified the fields, you can't expect the default view to work anymore.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.