Skip to content
Advertisement

How to inherent from a class that is already inherited from AbstractBaseUser in Django

I am trying to make an inheritance from a User class that is already inherited from the AbstractBaseUser but I am receiving an error that is telling me AUTH_USER_MODEL refers to model ‘authentication.User’ that has not been installed and I am sure I added the AUTH_USER_MODEL = ‘authentication.User’ in settings.py, I wonder how can I superpass this error and successfully inherent from the User Class this is the code:

JavaScript

Advertisement

Answer

For anyone who will encounter this later, I have solved this issue by using proxy models rather than using the abstract classes, you can also make a one to one field from the User class and use it for the other classes or you can simply create a role attribute in the User model rather than making other models for it and keep tracking for the roles in each view you make.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement