Environment settings¶
Django settings/overrides¶
DSMR-reader utilizes the Python Django framework. All settings below directly affect or override Django, and therefor your DSMR-reader installation as well.
Tip
You can either specify the following settings:
- in a
.env
file in the root of the DSMR-reader project folder (manual installations) - or as system environments variables (Docker installations)
DJANGO_SECRET_KEY
DJANGO_DATABASE_ENGINE
DJANGO_DATABASE_HOST
DJANGO_DATABASE_PORT
DJANGO_DATABASE_NAME
DJANGO_DATABASE_USER
DJANGO_DATABASE_PASSWORD
DJANGO_DATABASE_CONN_MAX_AGE
DJANGO_TIME_ZONE
DJANGO_STATIC_URL
DJANGO_FORCE_SCRIPT_NAME
DJANGO_USE_X_FORWARDED_HOST
DJANGO_USE_X_FORWARDED_PORT
DJANGO_X_FRAME_OPTIONS
DJANGO_STATIC_ROOT
DJANGO_SECRET_KEY
¶
The secret key Django should use. This should be randomly generated for your installation.
Generate or refresh it by running ./tools/generate-secret-key.sh
.
See also
See SECRET_KEY
in Django docs.
Hint
This setting is required
New in version v4.5.
Deprecated since version 4.5: Former SECRET_KEY
env var.
DJANGO_DATABASE_ENGINE
¶
The database engine to use. Officially DSMR-reader only supports django.db.backends.postgresql
, but others supported by Django may work as well.
Experiment at your own risk!
See also
See DATABASES.ENGINE
in Django docs.
Hint
This setting is required
New in version v4.5.
Deprecated since version 4.5: Former DB_ENGINE
env var.
DJANGO_DATABASE_HOST
¶
See also
See DATABASES.HOST
in Django docs.
Hint
This setting is required for the default DJANGO_DATABASE_ENGINE
, but can be optional for some engines.
New in version v4.5.
Deprecated since version 4.5: Former DB_HOST
env var.
DJANGO_DATABASE_PORT
¶
See also
See DATABASES.PORT
in Django docs.
Hint
This setting is required for the default DJANGO_DATABASE_ENGINE
, but can be optional for some engines.
New in version v4.5.
Deprecated since version 4.5: Former DB_PORT
env var.
DJANGO_DATABASE_NAME
¶
See also
See DATABASES.NAME
in Django docs.
Hint
This setting is required for the default DJANGO_DATABASE_ENGINE
, but can be optional for some engines.
New in version v4.5.
Deprecated since version 4.5: Former DB_NAME
env var.
DJANGO_DATABASE_USER
¶
See also
See DATABASES.USER
in Django docs.
Hint
This setting is required for the default DJANGO_DATABASE_ENGINE
, but can be optional for some engines.
New in version v4.5.
Deprecated since version 4.5: Former DB_USER
env var.
DJANGO_DATABASE_PASSWORD
¶
See also
See DATABASES.PASSWORD
in Django docs.
Hint
This setting is required for the default DJANGO_DATABASE_ENGINE
, but can be optional for some engines.
New in version v4.5.
Deprecated since version 4.5: Former DB_PASS
env var.
DJANGO_DATABASE_CONN_MAX_AGE
¶
See also
See DATABASES.CONN_MAX_AGE
in Django docs. Omit to use the default.
Hint
This setting is optional
New in version v4.5.
Deprecated since version 4.5: Former CONN_MAX_AGE
env var.
DJANGO_TIME_ZONE
¶
The timezone Django should use. Alter at your own risk. Omit to use the default, using the CET/CEST timezone (applicable to the Netherlands).
See also
See TIME_ZONE
in Django docs.
Hint
This setting is optional
New in version v4.5.
Deprecated since version 4.5: Former TZ
env var.
DJANGO_STATIC_URL
¶
See also
See STATIC_URL
in Django docs. Omit to use the default.
Hint
This setting is situational
New in version v4.5.
DJANGO_FORCE_SCRIPT_NAME
¶
See also
See FORCE_SCRIPT_NAME
in Django docs. Omit to use the default.
Hint
This setting is situational
New in version v4.5.
DJANGO_USE_X_FORWARDED_HOST
¶
See also
See USE_X_FORWARDED_HOST
in Django docs. Omit to use the default.
Hint
This setting is situational
New in version v4.5.
DJANGO_USE_X_FORWARDED_PORT
¶
See also
See USE_X_FORWARDED_PORT
in Django docs. Omit to use the default.
Hint
This setting is situational
New in version v4.5.
DJANGO_X_FRAME_OPTIONS
¶
See also
See X_FRAME_OPTIONS
in Django docs. Omit to use the default.
Hint
This setting is situational
New in version v4.5.
DJANGO_STATIC_ROOT
¶
See also
See STATIC_ROOT
in Django docs. Omit to use the default.
Hint
This setting is situational
New in version v4.6.
DSMR-reader settings¶
These settings are for DSMR-reader only.
Tip
You can either specify the following settings:
- in a
.env
file in the root of the DSMR-reader project folder (manual installations) - or as system environments variables (Docker installations)
DSMRREADER_ADMIN_USER
¶
The username of the webinterface (super)user to create when running ./manage.py dsmr_superuser
.
Hint
This setting is situational
New in version v4.5.
Deprecated since version 4.5: Former DSMR_USER
env var.
DSMRREADER_ADMIN_PASSWORD
¶
The password of the DSMRREADER_ADMIN_USER
user to create (or update if the user exists) when running ./manage.py dsmr_superuser
.
Hint
This setting is situational
New in version v4.5.
Deprecated since version 4.5: Former DSMR_PASSWORD
env var.
DSMRREADER_LOGLEVEL
¶
The log level DSMR-reader should use. Choose either ERROR
(omit for this default), WARNING
or DEBUG
(should be temporary due to file I/O).
See also
For more information, see Troubleshooting.
Hint
This setting is optional
New in version v4.5.
DSMRREADER_PLUGINS
¶
The plugins DSMR-reader should use. Omit to use the default of no plugins. Note that this should be a comma separated list when specifying multiple plugins. E.g.:
DSMRREADER_PLUGINS=dsmr_plugins.modules.plugin_name1
DSMRREADER_PLUGINS=dsmr_plugins.modules.plugin_name1,dsmr_plugins.modules.plugin_name2
See also
For more information, see Plugins.
Hint
This setting is optional
New in version v4.5.
DSMRREADER_SUPPRESS_STORAGE_SIZE_WARNINGS
¶
Whether to suppress any warnings regarding too many readings stored or the database size.
Set it to True
to disable the warnings or omit it to use the default (False
).
Suppress at your own risk.
Hint
This setting is optional
New in version v4.6.
DSMRREADER_MQTT_MAX_MESSAGES_IN_QUEUE
¶
The maximum amount of MQTT messages queued in DSMR-reader until new ones will be rejected. This prevents creating an infinite backlog of messages queued.
However, situationally you may increase the maximum for whatever reason along your local setup. Omit to use the default.
Hint
This setting is optional
Changed in version v5.0: (default value: 5000
)
New in version v4.16: (default value: 500
)
DSMRREADER_MQTT_MAX_CACHE_TIMEOUT
¶
DSMR-reader sends MQTT messages to your broker with a retain
flag, resulting the broker keeping the last value received for every topic.
Updating MQTT topics consecutively with the same value has no effect, depending on its usage.
Therefor DSMR-reader can be set to cache the last value sent for each topic. It will cause DSMR-reader to not send the same value to the same topic consecutively.
This was enabled by default in DSMR-reader v4.x
, but has been changed to being disabled by default since DSMR-reader v5.0
.
Set this value (cache duration in seconds) to > 0
to enable.
Hint
This setting is optional
Changed in version v5.0: (default value: 0
)
New in version v4.16: (default value: 3600
)