expand users table with django
I'm using the authentication that ships with django, and a开发者_如何学运维s 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?
Please see my (and others) answer to this question:
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.
精彩评论