﻿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
34252	"Doc page ""Using the Django authentication system"" shows failing example"	Johann Dreo	nobody	"The ""Using the Django authentication system"" documentation page, in the ""Creating user"" section [1], shows an example of how to create users manually.
However, this example fails.

The example code is:
{{{#!python
>>> from django.contrib.auth.models import User
>>> user = User.objects.create_user('john', 'lennon@thebeatles.com', 'johnpassword')
}}}

But running it in a `python manage.py shell` produces the following error:
{{{#!python
>>> from django.contrib.auth.models import User
>>> user = User.objects.create_user('john', 'lennon@thebeatles.com', 'johnpassword')
Traceback (most recent call last):
  File ""<console>"", line 1, in <module>
  File ""XXX/lib/python3.8/site-packages/django/db/models/manager.py"", line 187, in __get__
    raise AttributeError(
AttributeError: Manager isn't available; 'auth.User' has been swapped for 'core.User'
}}}

Documentation shows the same code example up to the ""dev"" version.

Witnessed on Django 3.2.12, on Linux core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch, Python 3.8.10 (default, Nov 14 2022, 12:59:47) 
[GCC 9.4.0].

[1] https://docs.djangoproject.com/en/3.2/topics/auth/default/#creating-users"	Bug	closed	Documentation	3.2	Normal	invalid			Unreviewed	0	0	0	0	0	0
