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.
import django
from django.conf import settings
settings.configure(
DATABASES={
'default': {
'ENGINE': '<your_engine>',
'NAME': '<database_name>',
'HOST': '<hostname_or_ip>',
'PORT': '<port>',
'USER': '<user>',
'PASSWORD': '<super_secret_password>',
}
},
INSTALLED_APPS=[
'<your_app>',
]
)
django.setup()