mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #20846 -- Decreased User.username max_length to 150 characters.
This commit is contained in:
parent
ea7542891a
commit
780bddf75b
4 changed files with 21 additions and 7 deletions
|
@ -21,12 +21,19 @@ Fields
|
|||
|
||||
.. attribute:: username
|
||||
|
||||
Required. 254 characters or fewer. Usernames may contain alphanumeric,
|
||||
Required. 150 characters or fewer. Usernames may contain alphanumeric,
|
||||
``_``, ``@``, ``+``, ``.`` and ``-`` characters.
|
||||
|
||||
The ``max_length`` should be sufficient for many use cases. If you need
|
||||
a longer length, please use a :ref:`custom user model
|
||||
<specifying-custom-user-model>`. If you use MySQL with the ``utf8mb4``
|
||||
encoding (recommended for proper Unicode support), specify at most
|
||||
``max_length=191`` because MySQL can only create unique indexes with
|
||||
191 characters in that case by default.
|
||||
|
||||
.. versionchanged:: 1.10
|
||||
|
||||
The ``max_length`` increased from 30 to 254 characters.
|
||||
The ``max_length`` increased from 30 to 150 characters.
|
||||
|
||||
.. attribute:: first_name
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue