API¶
app_defaults module¶
-
app_defaults.
settings
app_defaults.Settings object¶ Get a setting from django settings or app defaults. In that order
Parameters: - apps (list) – List of apps to search for a
defaults
module. It’s usually a subset of theINSTALLED_APPS
setting. The order matters - modules (list) – List of module objects to lookup for settings
- locals_only (bool) – This is
False
by default, mainly because it only works when the app’s path is relative to the running script. It’s considered better to pass the list of localapps
instead or make use ofcheck_magic_var
. This may be deprecated in the future - check_magic_var (bool) – This checks the magic var
DEFAULT_SETTINGS_MODULE = True
is present in each appdefaults
module. If the var isFalse
or does not exists, then the module is ignored.
- apps (list) – List of apps to search for a
Settings Object¶
-
class
app_defaults.
Settings
(apps=None, modules=None, locals_only=False, check_magic_var=False)¶ Get a setting from django settings or app defaults. In that order
Parameters: - apps (list) – List of apps to search for a
defaults
module. It’s usually a subset of theINSTALLED_APPS
setting. The order matters - modules (list) – List of module objects to lookup for settings
- locals_only (bool) – This is
False
by default, mainly because it only works when the app’s path is relative to the running script. It’s considered better to pass the list of localapps
instead or make use ofcheck_magic_var
. This may be deprecated in the future - check_magic_var (bool) – This checks the magic var
DEFAULT_SETTINGS_MODULE = True
is present in each appdefaults
module. If the var isFalse
or does not exists, then the module is ignored.
- apps (list) – List of apps to search for a