2

Hello I am very new to Django, and I am making an app that stores a lot of information about the user. But django's auth app stores only a bit of information about the user. Is there any way I can create my own model "User" and make Django's auth app use this model. Thanks.

Mahammad Adil Azeem
  • 9,112
  • 13
  • 57
  • 84

3 Answers3

1

You can solves your problem with UserProfile model. And you can store the user extra information in this with relation of onetone or ForeignKey with unique property field.

Django user profile

Community
  • 1
  • 1
dhana
  • 6,487
  • 4
  • 40
  • 63
1

U can multi-table inheritance the user model

from django.contrib.auth import User

class MyUser(User):
//add ur required fields

Reference for in heritance.

sundar nataraj
  • 8,524
  • 2
  • 34
  • 46
1

This has been supported since Django 1.5, and is fully covered in the documentation.

Basically, you need to subclass auth.models.AbstractUser, and set the AUTH_USER_MODEL setting to point to your new model.

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895