[Answered ]-Django first migration has one anonymous user

1👍

I’m by no means an expert here but looking through the django auth docs, it seems as though django creates this user to handle apps where users can choose not to authenticate and still interact with app in some level.

If the current user has not logged in, this attribute [request.user] will be set to an instance of AnonymousUser, otherwise it will be an instance of User.

Is this what you were looking for?

1👍

I have this issue with django-guardian, this apps creates AnonymousUser in the first migrate.

The docs says:

GUARDIAN_GET_INIT_ANONYMOUS_USER
New in version 1.2.
Guardian supports object level permissions for anonymous users, however when in
our project we use custom User model, default function might fail. This can lead
to issues as guardian tries to create anonymous user after each syncdb call.
Object that is going to be created is retrieved using function pointed by this
setting. Once retrieved, save method would be called on that instance.
Defaults to “guardian.management.get_init_anonymous_user”.

Leave a comment