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.
Asked
Active
Viewed 271 times
3 Answers
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.
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
-
if I make a model "User", in my app, that subclassess the auth.models.AbstractUser then will it be used the same way as the auth's User. I mean can I do something like `request.user.city` – Mahammad Adil Azeem Apr 21 '14 at 08:59
-
Yes that's the whole point, as long as you set AUTH_USER_MODEL. – Daniel Roseman Apr 21 '14 at 09:27