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 the INSTALLED_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 local apps instead or make use of check_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 app defaults module. If the var is False or does not exists, then the module is ignored.

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 the INSTALLED_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 local apps instead or make use of check_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 app defaults module. If the var is False or does not exists, then the module is ignored.