The following configurations are used by FlexMeasures.
Required settings (e.g. postgres db) are marked with a double star (**). To enable easier quickstart tutorials, these settings can be set by env vars. Recommended settings (e.g. mail, redis) are marked by one star (*).
Note: FlexMeasures is best configured via a config file. The config file for FlexMeasures can be placed in one of two locations:
- in the user's home directory (e.g.
~/.flexmeasures.cfg
on Unix). In this case, note the dot at the beginning of the filename! - in the apps's instance directory (e.g.
/path/to/your/flexmeasures/code/instance/flexmeasures.cfg
). The path to that instance directory is shown to you by running flexmeasures (e.g.flexmeasures run
) with required settings missing or otherwise by runningflexmeasures shell
.
Level above which log messages are added to the log file. See the logging
package in the Python standard library.
Default: logging.WARNING
The mode in which FlexMeasures is being run, e.g. "demo" or "play". This is used to turn on certain extra behaviours.
Default: ""
The command to run the scheduling solver.
Default: "cbc"
Configuration used for entity addressing. This contains the domain on which FlexMeasures runs and the first month when the domain was under the current owner's administration.
Default: {"flexmeasures.io": "2021-01"}
Relative path to the folder where database backups are stored if that feature is being used.
Default: "migrations/dumps"
Whether to turn on a feature which times requests made through FlexMeasures. Interesting for developers.
Default: False
Name being used in headings
Default: "FlexMeasures"
Whether to display the word "nan" if any value in metrics tables is NaN
.
Default: False
Interval in which viewing the queues dashboard refreshes itself, in miliseconds.
Default: 3000
(3 seconds)
Timezone in which the platform operates. This is useful when datetimes are being localized.
Default: "Asia/Seoul"
Time to live for UDI event ids of successful scheduling jobs. Set a negative timedelta to persist forever.
Default: timedelta(days=7)
The horizon to use when making schedules.
Default: timedelta(hours=2 * 24)
Token for accessing the DarkSky weather forecasting service.
Note: this will be soon become non-public, so we'll use another service.
Default: None
Token for accessing the mapbox API (for displaying maps on the dashboard and asset pages).
Default: None
Token which external services can use to check on the status of recurring tasks within FlexMeasures.
Default: None
This is only a selection of the most important settings. See the Flask-SQLAlchemy Docs for all possibilities.
Connection string to the postgres database, format: postgresql://<user>:<password>@<host-address>[:<port>]/<db>
Default: None
Configuration of the SQLAlchemy engine.
Default:
{
"pool_recycle": 299,
"pool_pre_ping": True,
"connect_args": {"options": "-c timezone=utc"},
}
This is only a selection of the most important settings. See the Flask-Security Docs as well as the Flask-CORS docs for all possibilities.
Used to sign user sessions and also as extra salt (a.k.a. pepper) for password salting if SECURITY_PASSWORD_SALT
is not set.
This is actually part of Flask - but is also used by Flask-Security to sign all tokens.
It is critical this is set to a strong value. For python3 consider using: secrets.token_urlsafe()
You can also set this in a file (which some Flask tutorials advised). leave this setting set to None
to get more instructions.
Default: None
Extra password salt (a.k.a. pepper)
Default: None
(falls back to SECRET_KEY
)
Name of the header which carries the auth bearer token in API requests.
Default: Authorization
Maximal age of security tokens in seconds.
Default: 60 * 60 * 6
(six hours)
Wether to track user statistics. Turning this on requires certain user fields. We do not use this feature, but we do track number of logins.
Default: False
Allowed cross-origins. Set to "*" to allow all. For development (e.g. javascript on localhost) you might use "null" in this list.
Default: []
FlexMeasures resources which get cors protection. This can be a regex, a list of them or dict with all possible options.
Default: [r"/api/*"]
Allows users to make authenticated requests. If true, injects the Access-Control-Allow-Credentials header in responses. This allows cookies and credentials to be submitted across domains.
Note: This option cannot be used in conjunction with a “*” origin
Default: True
For FlexMeasures to be able to send email to users (e.g. for resetting passwords), you need an email account which can do that (e.g. GMail).
This is only a selection of the most important settings. See the Flask-Mail Docs for others.
Email name server domain.
Default: "localhost"
SMTP port of the mail server.
Default: 25
Whether to use TLS.
Default: False
Whether to use SSL.
Default: False
Login name of the mail system user.
Default: None
Tuple of shown name of sender and their email address.
Default:
(
"FlexMeasures",
"no-reply@example.com",
)
Password of mail system user.
Default: None
FlexMeasures uses the Redis database to support our forecasting and scheduling job queues.
URL of redis server.
Default: "localhost"
Port of redis server.
Default: 6379
Number of the redis database to use (Redis per default has 16 databases, nubered 0-15)
Default: 0
Password of the redis server.
Default: None
When FLEXMEASURES_MODE=demo
, this can hold login credentials (demo user email and password, e.g. ("demo at seita.nl", "flexdemo")
), so anyone can log in and try out the platform.
Default: None
When FLEXMEASURES_MODE=demo
, this setting can be used to make the FlexMeasures platform select data from a specific year (e.g. 2015),
so that old imported data can be demoed as if it were current
Default: None
The control page is still mocked, so this setting controls if it is to be shown.
Default: False