class flask_waffleconf.core.WaffleConf(app=None, configstore=None)

Bases: object

Initialize the Flask-WaffleConf extension

  • app – Flask application instance
  • configstore (WaffleStore) – database store.


Direct access to the initialized state object.

init_app(app, configstore)

Initialize the extension for the given application and store.

Parse the configuration values stored in the database obtained from the WAFFLE_CONFS value of the configuration.

  • app – Flask application instance
  • configstore (WaffleStore) – database store.
class flask_waffleconf.core._WaffleState(app, configstore)

Bases: object

Store configstore for the app state.

This object will update its application’s configuration and if the WAFFLE_MULTIPROC setting is set to True, it will also notify other processes using Redis channel or file timestamp.

  • app – Flask application instance.
  • configstore (WaffleStore) – database store.

Parse configuration values from the database.

The extension must have been previously initialized.

If a key is not found in the database, it will be created with the default value specified.

Parameters:keys (list[str]) – list of keys to parse. If the list is empty, then all the keys known to the application will be used.
Returns:dict of the parsed config values.

Update configuration values from database.

This method should be called when there is an update notification.


Update database values and application configuration.

The provided keys must be defined in the WAFFLE_CONFS setting.

Parameters:new_values (dict) –

dict of configuration variables and their values The dict has the following structure: