I needed to add more fields to the User Django model , so I created a special model class (named Accounts ) in an application named accounts ) that extends the Django AbstractUser class .
After that, I updated the settings.py file with the AUTH_USER_MODEL property :
AUTH_USER_MODEL = 'accounts.Accounts'
Then I created a migration file for the user model using the command python manage.py makemigrations.
After that, I ran the command python manage.py migrateand I received this error message:
ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'accounts.accounts', but app 'accounts' isn't installed.
What is the cause of the error and how to fix it?
UPDATE: Now, if I run the command python manage.py makemigrations, I get this error message:
ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'accounts.accounts', but app 'accounts' doesn't provide model 'accounts'.
source
share