Fixed #20846 -- Decreased User.username max_length to 150 characters.

This commit is contained in:
Collin Anderson 2015-12-29 14:52:48 -05:00 committed by Tim Graham
parent ea7542891a
commit 780bddf75b
4 changed files with 21 additions and 7 deletions

View file

@ -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