Reputation: 38
I am making a web application using Django as my backend, and I was wondering what the best practice is when dealing with models representing user account information (username, password, email, etc.). I am aware of an existing User model, as well as the practice of creating a custom user model by subclassing AbstractUser
. However, I am confused as to how this is any different than subclassing models.Model
and creating my own user model from scratch.
Does anyone have advice as to what is best practice in this situation?
Upvotes: 0
Views: 609
Reputation: 397
I suppose Django User model has particular fields and if it enough for you use it. If you want to add new fields or change something that you can create new model. If you override User model good practice to define it via User = get_user_model()
.
Upvotes: 1