This commit is contained in:
2023-09-26 18:11:40 +02:00
commit 2de7f2fea1
8 changed files with 20 additions and 0 deletions

0
app/__init__.py Normal file
View File

15
app/config.py Normal file
View File

@@ -0,0 +1,15 @@
import configparser
from os import path
# parse base config file
config = configparser.ConfigParser()
config_path = path.dirname(path.abspath(__file__))
config.read(path.join(config_path, "../config_base.cfg"))
# check if custom configuration file exists and eventually load it
if path.exists((cfg_pth := path.join(config_path, "../config.cfg"))):
config.read(cfg_pth)
settings = {
"mongodb_url": config.get("DB","MONGODB_URL")
}