1👍
In newer versions of Django, you generally have a project directory containing the global, app-independent files like settings.py
and wsgi.py
. You can add global initialization code to __init__.py
in that directory.
Be advised that this code is run very early (even before the settings are loaded), so some parts of the Django API are not available yet.
Source:stackexchange.com