[Fixed]-Run some initialization code when Django (1.9) loads

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.

Leave a comment