Settings in Divio Cloud projects will either be configured by addons, or set manually.
Some settings, for example
MIDDLEWARE_CLASSES in older
versions of Django) are addon-configured settings in Divio Cloud projects, managed by the Aldryn
This allows applications to configure themselves when they are installed; for example, if an addon
requires certain applications to be listed in
INSTALLED_APPS, it will add them (this is taken
care of in the addon’s Application configuration with aldryn_config.py file). All these are then loaded into the
settings.py by the line:
If you declare a setting such as
aldryn_addons.settings.load(locals()), it may be overwritten by the addon system.
If you declare it after
aldryn_addons.settings.load(locals()), it will overwrite any
configuration performed by the addon system. In this case, your setting will apply, but be
aware that logic in the addon’s
aldryn_config.py might operate based on a different value,
with unpredictable results.
See How to configure Django settings for examples of how to handle these settings correctly.
Manually-configured settings, that are not required or handled by any other component, are
much easier, and can simply be dropped directly into your