flexmeasures.app

Starting point of the Flask application.

Functions

flexmeasures.app.create(env: str | None = None, path_to_config: str | None = None, plugins: list[str] | None = None, do_configure_logging: bool = True) → Flask

Create a Flask app and configure it.

Set the FlexMeasures environment this server runs in, by setting FLEXMEASURES_ENV either in your .flexmeasures.cfg config or as environment variable. Or, overwrite any FLEXMEASURES_ENV setting by passing an env in directly (useful for testing for instance).

A path to a config file can be passed in (otherwise a config file will be searched in the home or instance directories).

Also, a list of plugins can be set. Usually this works as a config setting, but this is useful for automated testing.

Pass do_configure_logging=False to prevent reconfiguring root logger handlers (e.g. during custom test setup).