I needed to add more fields to Django's User model, so I created a custom model class (named Accounts in an app named accounts) that extends Django's AbstractUser class.
After that, I updated my settings.py file, defining the AUTH_USER_MODEL property:
AUTH_USER_MODEL = 'accounts.Accounts'
I then created a migration file for the custom model using the python manage.py makemigrations
command.
After that, I ran the python manage.py migrate
command and I got 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's the cause of the error and how can I fix it?
UPDATE:
Now, if i run the python manage.py makemigrations
command, 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'.
accounts
package inINSTALLED_APPS
? – DeemINSTALLED_APPS
: INSTALLED_APPS = [ 'accounts.apps.AccountsConfig', 'inyavic.apps.InyavicConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] – OutwardsINSTALLED_APPS
there to make it easier to read). – Deem