Its not quite equivalent, since settings DJANGO_SETTINGS_MODULE
updates defaults, found in django.conf.settings.global_settings
, while parameter for configure
completely ignores them, so you have to add some additional processing.
Beware, first, that you can't modify INSTALLED_APPS
on the fly, as they are examined once on settings processing. For example, to apply modifications to INSTALLED_APPS in Apache-deployed application, you need to restart Apache.
Second, as settings are imported, therefore this point is prone to injections of some sorts, and is highly vulnerable to expose them to users.
If this is a meta app, there are two possibilities:
-
If you want to provide default settings for `django`-wise setting, add following to `default_settings.py` in your app:
INSTALLED_APPS = ('default_app', )
Just make sure you don't import `default_settings.py` in your app, and make your users add to their settings.pyfrom rexe_app.default_settings import * INSTALLED_APPS += ('users_app', )
that effectively will set `INSTALLED_APPS` to `('default_app', 'users_app', )` for your end users. -
In case you need `rexe_app`-wise settings, you can default them in your app's `__init__.py`:
from django.conf import settings REXE_APP_CONFIG_PARAM = getattr(settings, 'REXE_APP_CONFIG_PARAM', 'default_param_value')
so when user needs to change default `REXE_APP_CONFIG_PARAM` he needs to just addINSTALLED_APPS = ('rexe_app') REXE_APP_CONFIG_PARAM = 'user_param_value'
to his `settings.py`.