I was following the django documentation tutorial to make my first app, and then I reached the admin.py part and was trying to register my models, but then I got this error:
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.
My Folder Structure:
├───Poll
│ └───__pycache__
└───polls
├───migrations
│ └───__pycache__
└───__pycache__
Visual Representation:
My Code in admin.py:
from django.contrib import admin
from models import Question, Choice
admin.site.register(Question)
admin.site.register(Choice)
Settings.py:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'members.apps.MembersConfig',
]
