I want to sys.exit() the server when no settings module is defined.
As far as I'm aware a Django settings module can be passed in two ways:
- By running the server using
--settings=app.settings.foo - By setting an environment variable
DJANGO_SETTINGS_MODULE=app.settings.foo.
How can I detect in my app when no settings module is defined, and where would be a good place to put this?