24 lines
496 B
Python
24 lines
496 B
Python
"""Definition of web_ui main script."""
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
from .app import init_app
|
|
from shared.database import connect
|
|
from shared.utils import check_env
|
|
from shared.utils import setup_logging
|
|
|
|
# ensure env vars set
|
|
check_env()
|
|
|
|
# setup logging stream handler
|
|
setup_logging()
|
|
|
|
# connect to database
|
|
collection, db, client = connect()
|
|
|
|
# initialise application
|
|
app = init_app(collection=collection)
|
|
server = app.server
|
|
server.config.update(SECRET_KEY=os.urandom(24))
|