# quart.config module

class quart.config.Config(root_path, defaults=None)

  Bases: `Config`

  Parameters:

    - root_path (str | os.PathLike[str])

    - defaults (dict[str, t.Any] | None)

  from_prefixed_env(prefix='QUART', *, loads=json.loads)

    Load any environment variables that start with the prefix.

    The prefix (default `QUART_`) is dropped from the env key for the config key. Values are passed through a loading function to attempt to convert them to more specific types than strings.

    Keys are loaded in `sorted()` order.

    The default loading function attempts to parse values as any valid JSON type, including dicts and lists. Specific items in nested dicts can be set by separating the keys with double underscores (`__`). If an intermediate key doesn’t exist, it will be initialized to an empty dict.

    Parameters:

      - prefix (str) – Load env vars that start with this prefix, separated with an underscore (`_`).

      - loads (Callable[[str], Any]) – Pass each string value to this function and use the returned value as the config value. If any error is raised it is ignored and the value remains a string. The default is `json.loads()`.

    Return type:

      bool