django.core.exceptions.ImproperlyConfigured: Requested setting DATABASES, but settings are not configured.

Answered

I am new to Django, and I was inherited this Django project from previous developer.

I started using PyCharm for this Django project, and I have encountered this error.

The error message says:

"django.core.exceptions.ImproperlyConfigured: Requested setting DATABASES, but settings are not configured. You must either define environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings."

Thanks in advance.



Please see the attached image file for more details.

0
3 comments

Have you tried to define environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings? Also please attach a screenshot with `Settings| Languages&Frameworks| Django`.

1
Avatar
Permanently deleted user

1
Avatar
Permanently deleted user

I think the main issue was due to some error on "settings.py" file.

I added something that is not the name of app, but it is name of project. 

I tried to add the name under INSTALLED APPS = [ ], but with wrong app name. 

0

Please sign in to leave a comment.