title: Django app NameError however the app is installed
body: <p>I'm trying to modify Django's built-in authetnication system by adding a custom user model. The customized model is defined inside an app  named <code>accounts</code>:</p>
  <pre><code>from django.db import models
  from django.contrib.auth.models import AbstractUser
  from django.conf import settings
  
  # Create your models here.
  
  COUNTRIES = settings.COUNTRY_CHOICES
  
  class CustomUser(AbstractUser):
      zip_code = models.PositiveSmallIntegerField(blank=True, null=True)
      city = models.CharField(blank=True, null=True, max_length=64)
      address_street = models.CharField(blank=True, null=True, max_length=64)
      address_number = models.CharField(blank=True, null=True, max_length=32)
      country = models.CharField(blank=True, null=True, choices=COUNTRIES, max_length=8)
  </code></pre>
  <p>I updated the <code>settings.py</code> file this way:</p>
  <pre><code>AUTH_USER_MODEL = accounts.CustomUser
  </code></pre>
  <p>I added <code>accounts</code> as an installed app:</p>
  <pre><code>INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'accounts',
      'store',
      'cart',
  ]
  </code></pre>
  <p>When I try to run the <code>python manage.py makemigrations</code> command in terminal to apply changes made to the user model Django's throwing this error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:\Users\uhlar\Dev\ecommerce\manage.py&quot;, line 22, in &lt;module&gt;
      main()
    File &quot;C:\Users\uhlar\Dev\ecommerce\manage.py&quot;, line 18, in main
      execute_from_command_line(sys.argv)
    File &quot;C:\Users\uhlar\.virtualenvs\ecommerce-vU6zMECh\lib\site-packages\django\core\management\__init__.py&quot;, line 446, in execute_from_command_line        
      utility.execute()
    File &quot;C:\Users\uhlar\.virtualenvs\ecommerce-vU6zMECh\lib\site-packages\django\core\management\__init__.py&quot;, line 386, in execute
      settings.INSTALLED_APPS
    File &quot;C:\Users\uhlar\.virtualenvs\ecommerce-vU6zMECh\lib\site-packages\django\conf\__init__.py&quot;, line 87, in __getattr__
      self._setup(name)
    File &quot;C:\Users\uhlar\.virtualenvs\ecommerce-vU6zMECh\lib\site-packages\django\conf\__init__.py&quot;, line 74, in _setup
      self._wrapped = Settings(settings_module)
    File &quot;C:\Users\uhlar\.virtualenvs\ecommerce-vU6zMECh\lib\site-packages\django\conf\__init__.py&quot;, line 183, in __init__
      mod = importlib.import_module(self.SETTINGS_MODULE)
    File &quot;C:\Users\uhlar\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py&quot;, line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1050, in _gcd_import
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027, in _find_and_load
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006, in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688, in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883, in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241, in _call_with_frames_removed
    File &quot;C:\Users\uhlar\Dev\ecommerce\config\settings.py&quot;, line 149, in &lt;module&gt;
      AUTH_USER_MODEL = accounts.CustomUser
  NameError: name 'accounts' is not defined
  </code></pre>
  <p>The error is not only confined to the <code>accounts</code> app, no matter inside which app I try to define the <code>CustomUser</code> model I'm still getting it.</p>
  <p>If anyone knows what's causing the problem please help me to resolve it.</p>