Opened 6 months ago
Closed 6 months ago
#35327 closed Cleanup/optimization (wontfix)
Add note to create custom user model in tutorial
Reported by: | GeoGalvanic | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 5.0 |
Severity: | Normal | Keywords: | documentation |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
From the Customizing User Authentication documentation:
Changing AUTH_USER_MODEL after you’ve created database tables is significantly more difficult since it affects foreign keys and many-to-many relationships, for example.
Unfortunately, the tutorial doesn't mention the user model at all, meaning it would be quite easy for a new user to create their project long before they read over the user authentication documentation that could make their lives easier if they're planning on modifying the user model in the future.
Of course, ideally the process would be made simpler (as in: #25313) or the default project would be set up with a user model to make modifications easier later on (as in: #27909). Unfortunately neither have been solved in about 7 years 😱 , the former seems to be a difficult technical issue, and the later proposal seems to have the consensus that a DEP would need to be approved before being implemented, which could likely take additional years to solve.
In the meantime, we could add a note in the "Creating your first Django app" tutorial to let the users know that they may want to read the documentation on custom user models before proceeding. This would be a band-aid fix, but could help new users avoid stumbling into a trap of choosing between painful workarounds or simply creating a new project.
According to the Diátaxis framework, a tutorial should provide only the minimum necessary explanation. It cannot and shouldn't explain things as user customization. It's already mentioned loudly in the authorization topic in docs.