Django Error-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 also found this error on stack overflow.

The answer which solved my problem is

export DJANGO_SETTINGS_MODULE=mysites.settingshere, mysites is name of Django project where settings.py is available

paste the above line in bash shell before running standalone python script