conf package


conf.config_utils.from_envvar_file(envvar, environ=None)[source]
conf.config_utils.from_envvars(prefix=None, environ=None, envvars=None, as_json=True)[source]

Load environment variables in a dictionary

Values are parsed as JSON. If parsing fails with a ValueError, values are instead used as verbatim strings.

  • prefix – If None is passed as envvars, all variables from environ starting with this prefix are imported. The prefix is stripped upon import.
  • envvars – A dictionary of mappings of environment-variable-names to Flask configuration names. If a list is passed instead, names are mapped 1:1. If None, see prefix argument.
  • environ – use this dictionary instead of os.environ; this is here mostly for mockability
  • as_json – If False, values will not be parsed as JSON first.
conf.config_utils.load_configs(envvar_prefix, path=None)[source]

Load configuration

The following steps will be undertake:
  • It will attempt to load configs from file: if path is provided, it will be used, otherwise the path will be taken from envvar envvar_prefix + “SETTINGS”.
  • all envvars starting with envvar_prefix will be loaded.

return default configurations as simple dict


return the help message of a specific configuration parameter