forvaidya
forvaidya

Reputation: 3315

Custom User profile for Django user

Django - Models extension Vs User Profile

I want add some custom fields like following

 1. ssn 
 2. is_manager  
 3. manager

I have 2 choices - Extend AbstractBaseUser OR Create User profile based on signal and have OnetoOne field. Which one is better, future proof, DB migration friendly and maintainable ?

Upvotes: 1

Views: 1423

Answers (1)

Selcuk
Selcuk

Reputation: 59164

The Django documentation answers this question in detail:

If you wish to store information related to User, you can use a OneToOneField to a model containing the fields for additional information. This one-to-one model is often called a profile model, as it might store non-auth related information about a site user.

In your case, the added fields do not seem to be authentication related, so your best bet is to use the user profile method. Substituting a custom user model is overkill for such purposes.

Upvotes: 2

Related Questions