[Answer]-Django custom user VS user profile

1👍

When you have it all in one table, then database access is faster. With the old way you had to join on the auxiliary table to get all the information of the user.

Usually when you see a One-to-One relation, it would be better just to merge them in one table.

But the new custom User model solves also another problem, which is what atributes a User should have? What attributes are essential for your application? Is an email required? Should the email be also the username with which a user logs in?

You couldn’t do these stuff before this feature was introduced.

Regarding your question about where to put additional user information like “hobbies” and such, it really depends on how often you will query/need this attributes. Are they gonna be only on the user’s profile page? Well then you could have them in a seperate table and there wouldn’t be much problem or performance hit. Otherwise prefer to store them on the same table as the User.

Leave a comment