2

I'm using the authentication that ships with django, and as such, it comes with its own SQL table. I have a few more attributes I'd like to use with the User model that are custom to my app such as a user photo or a random user blob where users can type in notes.

what's the best way of extending the existing user table that ships with django's authentication/authorization modeling to allow for my custom fields?

randombits
  • 47,058
  • 76
  • 251
  • 433

2 Answers2

2

Please see my (and others) answer to this question:

Community
  • 1
  • 1
SingleNegationElimination
  • 151,563
  • 33
  • 264
  • 304
0

The other way to handle this is to do table inheritance on the User model and develop your own derived EnhancedUser model. Typically a custom wrapper backend is also written to make sure the auth subsystem returns the EnhancedUser model as well.

There's a very good blog post answer here.

T. Stone
  • 19,209
  • 15
  • 69
  • 97