The problem is that User
refers to django.contrib.auth.models.User
and now you have got a Custom User
pet.Person
assuming you have in the settings.py
AUTH_USER_MODEL = "pet.Person"
you have to define User
with the Custom User
model and you can do this with get_user_model
at the top of the file where you use User
from django.contrib.auth import get_user_model
User = get_user_model()
now you will be able to use Custom User
model and the problem has been fixed.