Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Django ORM Same Old ORM Model Upgrades

Hasan Ahmad
Hasan Ahmad
6,726 Points

The User model

What is the User model for? I do not understand the purpose of it. Please explain to me what this model does.

1 Answer

dublinruncommutr
dublinruncommutr
5,944 Points

User model is used by Django admin backend. Can also be used in the front-end for authentication or you can extend to support additional functionalities (perhaps you want to store other user attributes like photo, height, weight, etc.).

The Django docs discusses it pretty comprehensively: https://docs.djangoproject.com/en/2.0/topics/auth/customizing/

I have a Django app that extends the AUTH_USER_MODEL for leveraging social media accounts for trusted login to my app. It really can be quite useful to read up on what you can do with the User model - hopefully this helps a little bit - I'm sure I've only touched on a fraction of what you can do with it.