Why doesn’t django just have the model to use for User configured in the settings file?
The requirements on the model specified would be that it contain a certain set of fields.
Is there a reason why it couldn’t be done this way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The User model has a lot of dependencies and must conform to a diverse set of API requirements in order to interoperate with the rest of the django framework. This is because of its relationship with authentication and authorization. Changing
Usermeans changing the expected behavior ofcontrib.auth. If you want to do that, you can, and that is configurable in settings.py.More likely, what you want to configure is the extra metadata that relates with users. This extra info isn’t in any way involved with authentication, and so it can be configured separately without affecting contrib.auth. In order to make the dependencies easy to manage, this is handled in a separate model. This has the added benefit of making the distinction between authorization dependent data and site specific user metadata much clearer.