run with all params

This commit is contained in:
Egor Svitin
2023-02-07 12:11:39 +03:00
parent 14c011b921
commit 2615ce4b1d
2 changed files with 6 additions and 7 deletions

View File

@@ -9,14 +9,14 @@ from configs.configs import CONFIGS
class AppConfig:
def __init__(self):
self.refresh()
self.refresh()
connect(
db=CONFIGS['db']['name'],
host="mongodb://{host}:27017/{database}".format(host=CONFIGS['db']['host'], database=CONFIGS['db']['name'])
)
def refresh(self):
self.config = Dynaconf(settings_files=[
def refresh(self):
self.config = Dynaconf(settings_files=[
"/app/configs/main.json",
"/app/configs/sources.json"
])
@@ -52,6 +52,6 @@ class AppConfig:
with open("./configs/sources.json", "w") as outfile:
outfile.write(json.dumps(new_config))
self.refresh()
self.refresh()
config = AppConfig()