Fix DJANGO_SETTINGS_MODULE environment handling.