-
Notifications
You must be signed in to change notification settings - Fork 944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update models.py - Referencing the User model #127
Conversation
Referencing the User model as described in the django documentation https://docs.djangoproject.com/en/4.2/topics/auth/customizing/#referencing-the-user-model . This ensures that projects working with custom User models will also function correctly, and I believe this is considered best practice for referencing the user model in Django.
It looks like this is your first pull request. 🎉 Thank you for your contribution! One of the project maintainers will triage and assign the pull request for review. We appreciate your patience. To safeguard the health of the project, please take a moment to read our code of conduct. |
Thanks very much. You're right. There's going to be some delay though, because we need to make corresponding changes to MDN content. |
Co-authored-by: Özgür <ozgurturkiye@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much. I'm going to merge this. Still waiting on the MDN-side PR though.
Congratulations on your first merged pull request. 🎉 Thank you for your contribution! Did you know we have a project board with high-impact contribution opportunities? We look forward to your next contribution. |
MDN URL
https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Authentication#models
What specific section or headline is this issue about?
Django Tutorial Part 8: User authentication and permissions -> Models -> Referencing the User model
Description of Possible Improvement
Referencing the User model as described in the django documentation https://docs.djangoproject.com/en/4.2/topics/auth/customizing/#referencing-the-user-model . This ensures that projects working with custom User models will also function correctly, and I believe this is considered best practice for referencing the user model in Django.
Description
I have adjusted the way the user model is being referenced in the models.py file because I believe the method shown in the documentation doesn't represent the recommended way of referencing it.
Motivation
I believe that these changes are necessary in order to follow the best practices for referencing the user model. Additionally, when defining custom user models, the method provided in the documentation would not work, potentially leading to future problems with the project.
Additional details
Here the link from the Django docuemntation suporting my point:
https://docs.djangoproject.com/en/4.2/topics/auth/customizing/#referencing-the-user-model
Related issues and pull requests