mirror of
https://github.com/django/django.git
synced 2025-04-01 12:06:43 +00:00
[5.1.x] Fixed #35767 -- Adjusted customizing User model docs.
Backport of c0128e3a81cfb07238324b185958a88631e94963 from main.
This commit is contained in:
parent
c12fe0a724
commit
d96b661135
@ -400,10 +400,9 @@ the Django model that you wish to use as your user model.
|
|||||||
Using a custom user model when starting a project
|
Using a custom user model when starting a project
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
|
|
||||||
If you're starting a new project, it's highly recommended to set up a custom
|
If you're starting a new project, you can set up a custom user model that
|
||||||
user model, even if the default :class:`~django.contrib.auth.models.User` model
|
behaves identically to the default user model by subclassing
|
||||||
is sufficient for you. This model behaves identically to the default user
|
:class:`~django.contrib.auth.models.AbstractUser`::
|
||||||
model, but you'll be able to customize it in the future if the need arises::
|
|
||||||
|
|
||||||
from django.contrib.auth.models import AbstractUser
|
from django.contrib.auth.models import AbstractUser
|
||||||
|
|
||||||
@ -426,7 +425,7 @@ Changing to a custom user model mid-project
|
|||||||
-------------------------------------------
|
-------------------------------------------
|
||||||
|
|
||||||
Changing :setting:`AUTH_USER_MODEL` after you've created database tables is
|
Changing :setting:`AUTH_USER_MODEL` after you've created database tables is
|
||||||
significantly more difficult since it affects foreign keys and many-to-many
|
possible, but can be complex, since it affects foreign keys and many-to-many
|
||||||
relationships, for example.
|
relationships, for example.
|
||||||
|
|
||||||
This change can't be done automatically and requires manually fixing your
|
This change can't be done automatically and requires manually fixing your
|
||||||
|
Loading…
x
Reference in New Issue
Block a user