djangofloor.conf.providers
¶
Providers of Django settings¶
Settings that are merged to provide the final Django settings come from different kinds of sources (Python modules or files, ini files, …).
-
class
djangofloor.conf.providers.
ConfigFieldsProvider
[source]¶ Provides a list of
djangofloor.conf.fields.ConfigField
. Used for retrieving settings from a config file.-
name
= None¶
-
-
class
djangofloor.conf.providers.
ConfigProvider
[source]¶ Base class of config provider.
-
get_extra_settings
()[source]¶ Return all settings internally defined.
Returns: an iterable of (setting_name, value)
-
get_value
(config_field)[source]¶ Get the internal value if the config field is present in its internal values. Otherwise returns the current value of the config field.
-
is_valid
()[source]¶ Return True if the provider is valid (for example, the corresponding file is missing).
-
name
= None¶
-
-
class
djangofloor.conf.providers.
DictProvider
(values)[source]¶ Use a plain Python dict as a setting provider
-
name
= 'dict'¶
-
-
class
djangofloor.conf.providers.
IniConfigProvider
(config_file=None)[source]¶ Read a config file using the .ini syntax.
-
get_value
(config_field: djangofloor.conf.fields.ConfigField)[source]¶ get option from the config file
-
has_value
(config_field: djangofloor.conf.fields.ConfigField)[source]¶ return True if the option is defined in the config file
-
name
= '.ini file'¶
-
-
class
djangofloor.conf.providers.
PythonConfigFieldsProvider
(value=None)[source]¶ Provide a list of
djangofloor.conf.fields.ConfigField
from an attribute in a Python module.-
name
= 'Python attribute'¶
-
-
class
djangofloor.conf.providers.
PythonFileProvider
(module_filename)[source]¶ Load a Python module from the filename
-
name
= 'Python file'¶
-
-
class
djangofloor.conf.providers.
PythonModuleProvider
(module_name=None)[source]¶ Load a Python module from its dotted name
-
get_extra_settings
()[source]¶ Return all values that look like a Django setting (i.e. uppercase variables)
-
name
= 'Python module'¶
-