-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
28 lines (26 loc) · 1.05 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from dynaconf import Dynaconf, Validator
PREFIX = "ECOBALYSE"
settings = Dynaconf(
envvar_prefix=PREFIX,
settings_files=["settings.toml"],
environments=True,
load_dotenv=True,
dotenv_verbose=True,
default_env="default", # env where the default values will be taken from
env="development", # this is the active env, by default
env_switcher="ECOBALYSE_ENV",
validators=[
# Check that the output dir was set
Validator(
"OUTPUT_DIR",
must_exist=True,
messages={
"must_exist_true": "🚨 ERROR: For the export to work properly, you need to specify "
+ PREFIX
+ "_{name} env variable. It needs to point to the 'public/data/' directory of https://github.com/MTES-MCT/ecobalyse/ repository. Please, edit your .env file accordingly or add the {name} variable to your `settings.toml` file."
},
),
],
)
# `envvar_prefix` = export envvars with `export ECOBALYSE_FOO=bar`.
# `settings_files` = Load these files in the order.