-
I just started a new project in django, I run the command ‘django-admin startproject + project_name’, and ‘python manage.py startapp + app_name’.
It creates a project and app. -
I also added my new app to the settings INSTALLED_APPS.
2.After that I tried to create my first module on ‘modules.py’ file on my app, but when I do it and run the file, it gives me this error message:
The entire error message says: " 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. "
I created a few projects before, and never saw this problem.
I discovered that if I dont use the ‘models.Model’ on my class, it does not gives me this error.
Someone knows what it is about? I didnt change anything on settings.py file, just added the app name. Maybe its normal to have this error message, when we run the ‘modules.py’ file, and we should just ignore it?
Thank you in advance!