fix(cli): Set env variable for debug

This commit is contained in:
Ferdinand Thiessen 2021-12-06 15:32:11 +01:00
parent d8192679e5
commit 653c1c584c
1 changed files with 2 additions and 1 deletions

View File

@ -5,7 +5,7 @@ import argparse
import sys import sys
import pkg_resources import pkg_resources
from sqlalchemy import exc from os import environ
from flaschengeist.app import create_app, install_all from flaschengeist.app import create_app, install_all
from flaschengeist.config import config from flaschengeist.config import config
@ -142,6 +142,7 @@ def run(arguments):
with app.app_context(): with app.app_context():
app.wsgi_app = PrefixMiddleware(app.wsgi_app, prefix=config["FLASCHENGEIST"].get("root", "")) app.wsgi_app = PrefixMiddleware(app.wsgi_app, prefix=config["FLASCHENGEIST"].get("root", ""))
if arguments.debug: if arguments.debug:
environ["FLASK_DEBUG"] = "1"
app.run(arguments.host, arguments.port, debug=True) app.run(arguments.host, arguments.port, debug=True)
else: else:
app.run(arguments.host, arguments.port, debug=False) app.run(arguments.host, arguments.port, debug=False)