flaschengeist/flaschengeist/__init__.py

22 lines
631 B
Python

""" Server-package
Initialize app, CORS, database and add it to the application.
Initialize also a singleton for the AccessTokenController and start the Thread.
"""
import yaml
import logging
import pkg_resources
from pathlib import Path
from logging.config import dictConfig
from werkzeug.local import LocalProxy
__version__ = pkg_resources.get_distribution("flaschengeist").version
_module_path = Path(__file__).parent
logger = LocalProxy(lambda: logging.getLogger(__name__))
with (_module_path / "logging.yml").open(mode="rb") as file:
config = yaml.safe_load(file.read())
logging.config.dictConfig(config)