class models.AnonymousUser
django.contrib.auth.models.AnonymousUser
is a class that implements the django.contrib.auth.models.User
interface, with these differences:
-
id is always
None
. -
username
is always the empty string. -
get_username()
always returns the empty string. -
is_anonymous
isTrue
instead ofFalse
. -
is_authenticated
isFalse
instead ofTrue
. -
is_staff
andis_superuser
are alwaysFalse
. -
is_active
is alwaysFalse
. -
groups
anduser_permissions
are always empty. -
set_password()
,check_password()
,save()
anddelete()
raiseNotImplementedError
.
In practice, you probably won’t need to use AnonymousUser
objects on your own, but they’re used by Web requests, as explained in the next section.
Please login to continue.