Files
visual_critical_discourse_a…/web_ui/src/main.py
T
2025-04-15 21:56:33 +00:00

34 lines
659 B
Python

"""Definition of web_ui main script."""
from __future__ import annotations
import os
from shared.utils import check_env, setup_logging
from .app import init_app
# ensure env vars set
NECESSARY_ENV_VAR_LIST = {
'MONGO_ENDPOINT',
'MONGO_DB',
'MONGO_COLLECTION',
'MONGO_USER',
'MONGO_PASSWORD',
'DASH_AUTH_USERNAME',
'DASH_AUTH_PASSWORD',
'MINIO_ENDPOINT',
'MINIO_ACCESS_KEY',
'MINIO_SECRET_KEY',
'MINIO_BUCKET_NAME',
}
check_env(NECESSARY_ENV_VAR_LIST)
# setup logging stream handler
setup_logging()
# initialise application
app = init_app()
server = app.server
server.config.update(SECRET_KEY=os.urandom(24))