Allow adding to INSTALLED_APPS from local_settings.py

Defines a new option, ADD_INSTALLED_APPS, which gets prepended
to the beginning of INSTALLED_APPS.

Change-Id: I956835c3e18edee9e223a607005b47a5c5977687
Closes-bug: #1343342
This commit is contained in:
Radomir Dopieralski 2014-07-17 17:19:52 +02:00
parent 43e0c2b998
commit ce3fea4921
3 changed files with 12 additions and 1 deletions

View File

@ -977,6 +977,15 @@ are generally safe to use.
When CSRF_COOKIE_SECURE or SESSION_COOKIE_SECURE are set to True, these attributes
help protect the session cookies from cross-site scripting.
``ADD_INSTALLED_APPS``
----------------------
.. versionadded:: 2015.1(Kilo)
A list of Django applications to be prepended to the ``INSTALLED_APPS``
setting. Allows extending the list of installed applications without having
to override it completely.
.. _pluggable-settings-label:

View File

@ -251,6 +251,7 @@ SECURITY_GROUP_RULES = {
},
}
ADD_INSTALLED_APPS = []
try:
from local.local_settings import * # noqa
except ImportError:
@ -266,6 +267,7 @@ settings.update_dashboards([
openstack_dashboard.enabled,
openstack_dashboard.local.enabled,
], HORIZON_CONFIG, INSTALLED_APPS)
INSTALLED_APPS[0:0] = ADD_INSTALLED_APPS
# Ensure that we always have a SECRET_KEY set, even when no local_settings.py
# file is present. See local_settings.py.example for full documentation on the

View File

@ -138,4 +138,4 @@ def update_dashboards(modules, horizon_config, installed_apps):
horizon_config.setdefault('angular_modules', []).extend(angular_modules)
horizon_config.setdefault('js_files', []).extend(js_files)
horizon_config.setdefault('js_spec_files', []).extend(js_spec_files)
installed_apps[:] = apps + installed_apps
installed_apps[0:0] = apps