adding extra fields to user model django 1

adding extra fields to user model django

class UserProfile(models.Model):
   user = models.OneToOneField(User)
    ...#the fields you need

Here is what the above code is Doing:
1. Create a new model called UserProfile.
2. Link UserProfile to a User model instance.
3. Create a OneToOneField which will serve as an identifier.
4. Add additional fields you want on your model.

Similar Posts