Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improper Configurations #3

Open
umair313 opened this issue Oct 15, 2021 · 0 comments
Open

Improper Configurations #3

umair313 opened this issue Oct 15, 2021 · 0 comments

Comments

@umair313
Copy link

I get this error when I try to import User Model

(venv) D:\Python\Django\django-production-template\simple>python

Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from django.contrib.auth.models import User
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Python\Django\django-production-template\venv\lib\site-packages\django\contrib\auth\models.py", line 3, in <module>
    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
  File "D:\Python\Django\django-production-template\venv\lib\site-packages\django\contrib\auth\base_user.py", line 48, in <module>
    class AbstractBaseUser(models.Model):
  File "D:\Python\Django\django-production-template\venv\lib\site-packages\django\db\models\base.py", line 108, in __new__
    app_config = apps.get_containing_app_config(module)
  File "D:\Python\Django\django-production-template\venv\lib\site-packages\django\apps\registry.py", line 253, in get_containing_app_config
    self.check_apps_ready()
  File "D:\Python\Django\django-production-template\venv\lib\site-packages\django\apps\registry.py", line 135, in check_apps_ready
    settings.INSTALLED_APPS
  File "D:\Python\Django\django-production-template\venv\lib\site-packages\django\conf\__init__.py", line 82, in __getattr__
    self._setup(name)
  File "D:\Python\Django\django-production-template\venv\lib\site-packages\django\conf\__init__.py", line 63, in _setup
    raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant