Update Flask and Jinja

Flask Autoversion is now integrated
Flask config.from_file is now integrated
This commit is contained in:
Fabian Dill
2021-05-13 00:28:53 +02:00
parent c0bf4f58ad
commit d35adc5868
4 changed files with 5 additions and 12 deletions

View File

@@ -8,16 +8,14 @@ from waitress import serve
from WebHostLib.models import db
from WebHostLib.autolauncher import autohost
configpath = "config.yaml"
configpath = os.path.abspath("config.yaml")
def get_app():
app = raw_app
if os.path.exists(configpath):
import yaml
with open(configpath) as c:
app.config.update(yaml.safe_load(c))
app.config.from_file(configpath, yaml.safe_load)
logging.info(f"Updated config from {configpath}")
db.bind(**app.config["PONY"])
db.generate_mapping(create_tables=True)