I\'m trying to run a populate script which I put together from the tango_with_django tutorial (https://github.com/leifos/tango_with_django/blob/master/tango_with_django_project/
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'epl.settings')
should be above
import django
which is you should call django_settings_module before importing and calling django setup.
Hope this is helpful.