diff --git a/the_works/__init__.py b/the_works/__init__.py index 034e4bd..b6bdf4d 100644 --- a/the_works/__init__.py +++ b/the_works/__init__.py @@ -4,7 +4,6 @@ from flask import Flask from the_works.database import init_db from flask_debugtoolbar import DebugToolbarExtension - def create_app(): app = Flask(__name__) @@ -14,14 +13,8 @@ def create_app(): if os.getenv("SQLALCHEMY_DATABASE_DIALECT") == "sqlite": app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///" + os.path.abspath(app.root_path + "/..") + "/" + os.getenv("SQLALCHEMY_DATABASE_SQLITE_FILENAME") else: - pass + exit("no SQLite database URI given; exiting") - # DEBUG - app.config["SQLALCHEMY_ECHO"] = True - - print(f"Current Environment: " + app.config['ENVIRONMENT']) - print(f"SQLAlchemy DB URI: " + app.config['SQLALCHEMY_DATABASE_URI']) - # initialize database init_db(app) @@ -31,6 +24,9 @@ def create_app(): app.register_blueprint(home.bp) app.register_blueprint(werk.bp) + ### DEBUG + app.config["SQLALCHEMY_ECHO"] = True + print(f"Current Environment: " + app.config['ENVIRONMENT']) # load debug toolbar toolbar = DebugToolbarExtension(app)