mirror of
https://github.com/simple-login/app.git
synced 2024-09-20 15:05:59 +08:00
move SQLALCHEMY_ECHO option to create_app(): useful when profiling
This commit is contained in:
parent
aba0a534c0
commit
f04caa3c35
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue