bocadillo.config

LazySettings

LazySettings(self)

A lazy proxy for application settings.

Once configured, an instance of this class can be used to access settings from anywhere in the application code base.

Such an instance is in fact exposed as bocadillo.settings.

Settings can be accessed using:

  • Dot notation: settings.FOO.
  • The getattr builtin: getattr(settings, "FOO").
  • The dict-like .get() method: settings.get("FOO", "foo").