[Django] #35327: Add note to create custom user model in tutorial

8 views
Skip to first unread message

Django

unread,
Mar 24, 2024, 6:02:56 AM3/24/24
to django-...@googlegroups.com
#35327: Add note to create custom user model in tutorial
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
GeoGalvanic |
Type: | Status: new
Cleanup/optimization |
Component: | Version: 5.0
Documentation |
Severity: Normal | Keywords: documentation
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
From the [https://docs.djangoproject.com/en/5.0/topics/auth/customizing
/#changing-to-a-custom-user-model-mid-project "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:
[https://code.djangoproject.com/ticket/25313 #25313]) or the default
project would be set up with a user model to make modifications easier
later on (as in: [https://code.djangoproject.com/ticket/27909 #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.
--
Ticket URL: <https://code.djangoproject.com/ticket/35327>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 24, 2024, 11:04:07 AM3/24/24
to django-...@googlegroups.com
#35327: Add note to create custom user model in tutorial
-------------------------------------+-------------------------------------
Reporter: GeoGalvanic | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 5.0
Severity: Normal | Resolution: wontfix
Keywords: documentation | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* resolution: => wontfix
* status: new => closed

Comment:

According to the Diátaxis framework, [https://diataxis.fr/tutorials
/#offer-only-minimum-necessary-explanation 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
[https://docs.djangoproject.com/en/stable/topics/auth/customizing/#using-a
-custom-user-model-when-starting-a-project authorization topic in docs].
--
Ticket URL: <https://code.djangoproject.com/ticket/35327#comment:1>
Reply all
Reply to author
Forward
0 new messages