AUTH_USER_MODEL refers to model 'restro_app.CustomUser' that has not been installed

48 views
Skip to first unread message

Kushal Neupane

unread,
Mar 26, 2020, 12:37:04 PM3/26/20
to Django developers (Contributions to Django itself)
D:\Development\Backup\2\restroapp>python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\apps\registry.py", line 155, in get_app_config
    return self.app_configs[app_label]
KeyError: 'restro_app'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\contrib\auth\__init__.py", line 156, in get_user_model
    return django_apps.get_model(settings.AUTH_USER_MODEL, require_ready=False)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\apps\registry.py", line 205, in get_model
    app_config = self.get_app_config(app_label)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\apps\registry.py", line 162, in get_app_config
    raise LookupError(message)
LookupError: No installed app with label 'restro_app'.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python36-32\lib\threading.py", line 916, in _bootstrap_inner
    self.run()
  File "C:\Program Files (x86)\Python36-32\lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\utils\autoreload.py", line 76, in raise_last_exception
    raise _exception[1]
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\core\management\__init__.py", line 357, in execute
    autoreload.check_errors(django.setup)()
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\apps\registry.py", line 122, in populate
    app_config.ready()
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\contrib\admin\apps.py", line 24, in ready
    self.module.autodiscover()
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\contrib\admin\__init__.py", line 26, in autodiscover
    autodiscover_modules('admin', register_to=site)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\utils\module_loading.py", line 47, in autodiscover_modules
    import_module('%s.%s' % (app_config.name, module_to_search))
  File "C:\Program Files (x86)\Python36-32\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\contrib\auth\admin.py", line 6, in <module>
    from django.contrib.auth.forms import (
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\contrib\auth\forms.py", line 20, in <module>
    UserModel = get_user_model()
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\contrib\auth\__init__.py", line 161, in get_user_model
    "AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings.AUTH_USER_MODEL
django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'restro_app.CustomUser' that has not been installed

Dhruv Agarwal

unread,
Mar 26, 2020, 2:12:17 PM3/26/20
to Django developers (Contributions to Django itself)
I suppose your problem is that you haven't configured your retro_app

So,You first need to add "retro_app" in list of installed_apps in settings.py.

Correct me if I understand the issue wrongly.

Adam Johnson

unread,
Mar 26, 2020, 2:55:21 PM3/26/20
to django-d...@googlegroups.com
Hi!

I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer your support query with their limited time and energy. Read more on the mailing lists at https://www.djangoproject.com/community/

For support, please use the NEW Django forum at https://forum.djangoproject.com , django-users mailing list, or IRC #django on Freenode, or a site like Stack Overflow. There are people out there willing to help on those channels, but they might not respond if you don't ask your question well. Stack Overflow's question guide can help you frame it well: https://stackoverflow.com/help/how-to-ask .

Also if you haven't read it, please take a look at Django's Code of Conduct: https://www.djangoproject.com/conduct/ . These are our "ground rules" for working well as a community, and will help you get the most out of Django and our fantastic community.

Thanks for your understanding,

Adam

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/8c13a393-cd14-4489-afff-2d7277760683%40googlegroups.com.


--
Adam
Reply all
Reply to author
Forward
0 new messages