Currently I created another class/table called MyAppUser
with my custom columns (such as address and phone number) that has a foreign key to Django\'s authenticatio
Django provides built-in support for extending the user with your own properties, called User Profiles.
That is generally the method I prefer, I don't like to touch the Django user just to be safe. This way you know you aren't going to conflict with anything in the user model, and it makes it clear which code is framework code and which is your code.
I normally don't call it MyAppUser
but more usually, something like UserSettings
. I don't want my user related classes to be confused as replacements for the User
object, but simply provide more information.
Generally in apps you will have foreign keys to User
all over the place, so I still use Django User
class for all those as well. I find it keep things cleaner.
I have tried to subclass User
and found it didn't give me much, and ended up confusing things, more than they needed to be.