From f04caa3c358b68338e249ec581a6c097d85d9a1e Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Fri, 15 May 2020 16:48:42 +0200 Subject: [PATCH] move SQLALCHEMY_ECHO option to create_app(): useful when profiling --- server.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index 2d7b4da6..b15c3952 100644 --- a/server.py +++ b/server.py @@ -78,6 +78,9 @@ def create_app() -> Flask: app.config["SQLALCHEMY_DATABASE_URI"] = DB_URI app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False + # enable to print all queries generated by sqlalchemy + # app.config["SQLALCHEMY_ECHO"] = True + app.secret_key = FLASK_SECRET app.config["TEMPLATES_AUTO_RELOAD"] = True @@ -168,7 +171,6 @@ def fake_data(): for i in range(31): if i % 2 == 0: a = Alias.create_new(user, f"e{i}@", mailbox_id=m1.id) - else: a = Alias.create_new(user, f"e{i}@") db.session.commit() @@ -546,8 +548,7 @@ if __name__ == "__main__": # # toolbar = DebugToolbarExtension(app) - # enable to print all queries generated by sqlalchemy - # app.config["SQLALCHEMY_ECHO"] = True + # warning: only used in local if RESET_DB: