﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28415	Clarify what characters ASCIIUsernameValidator and UnicodeUsernameValidator accept	Dan Collins	nobody	"Hello,

While investigating the current and historical validation rules for usernames in Django, I noticed the following inconsistency, which is visible on the following page:

https://docs.djangoproject.com/en/1.11/ref/contrib/auth/#django.contrib.auth.models.User.username_validator

{{{
username¶
Required. 150 characters or fewer. Usernames may contain alphanumeric, _, @, +, . and - characters.
}}}

but

{{{
class validators.ASCIIUsernameValidator¶
New in Django 1.10.
A field validator allowing only ASCII letters, in addition to @, ., +, -, and _. The default validator for User.username on Python 2.

class validators.UnicodeUsernameValidator¶
New in Django 1.10.
A field validator allowing Unicode letters, in addition to @, ., +, -, and _. The default validator for User.username on Python 3.
}}}

The documentation is inconsistent on whether ASCII numbers are allowed in usernames at all, and whether Unicode numbers are allowed in usernames when using the Unicode validator or Python 3.

Further, in light of this, the following paragraph isn't clear:

{{{
Usernames and Unicode

Django originally accepted only ASCII letters in usernames. Although it wasn’t a deliberate choice, Unicode characters have always been accepted when using Python 3. Django 1.10 officially added Unicode support in usernames, keeping the ASCII-only behavior on Python 2, with the option to customize the behavior using User.username_validator.
}}}

I believe that Django originally accepted only ASCII letters and **numbers** in usernames.

Note that there is such a thing as a Unicode number: I suspect the Unicode validator accepts all letter and number classes - not just 0-9, but also characters like ६ (Devanagari 6), ೬ (Kannada 6), ¹ (superscript), but reading the documentation makes me doubt this."	Cleanup/optimization	closed	Documentation	1.11	Normal	fixed			Accepted	1	0	0	0	1	0
