ValueError in Django when running the "python manage.py migrate" command
<p>I needed to add more fields to Django's <strong>User</strong> model, so I created a custom model class (named <strong>Accounts</strong> in an app named <strong>accounts</strong>) that extends Django's <strong>AbstractUser</strong> class.</p>

<p>After that, I updated my <strong>settings.py</strong> file, defining the <strong>AUTH_USER_MODEL property</strong>:</p>

<pre><code>AUTH_USER_MODEL = 'accounts.Accounts'
</code></pre>

<p>I then created a migration file for the custom model using the <code>python manage.py makemigrations</code> command.</p>

<p>After that, I ran the <code>python manage.py migrate</code> command and I got this error message:</p>

<pre><code>ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'accounts.accounts', but app 'accounts' isn't installed.
</code></pre>

<p>What's the cause of the error and how can I fix it?</p>

<p>UPDATE:
Now, if i run the <code>python manage.py makemigrations</code> command, I get this error message:</p>

<pre><code>ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'accounts.accounts', but app 'accounts' doesn't provide model 'accounts'.
</code></pre>