Python中Flask框架SQLALCHEMY_ECHO设置

在用配置类的方式给app设置配置时, SQLALCHEMY_ECHO 这个是记录打印SQL语句用于调试的, 一般设置为False, 不然会在控制台输出一大堆的东西 

 

/home/python/.virtualenvs/py3_flask/bin/python /home/python/Desktop/test/demo_sqlalchemy.py
2018-12-27 17:46:54,205 INFO sqlalchemy.engine.base.Engine SHOW VARIABLES LIKE 'sql_mode'
2018-12-27 17:46:54,205 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,208 INFO sqlalchemy.engine.base.Engine SHOW VARIABLES LIKE 'lower_case_table_names'
2018-12-27 17:46:54,208 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,211 INFO sqlalchemy.engine.base.Engine SELECT DATABASE()
2018-12-27 17:46:54,211 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,212 INFO sqlalchemy.engine.base.Engine show collation where `Charset` = 'utf8mb4' and `Collation` = 'utf8mb4_bin'
2018-12-27 17:46:54,212 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,214 INFO sqlalchemy.engine.base.Engine SELECT CAST('test plain returns' AS CHAR(60)) AS anon_1
2018-12-27 17:46:54,214 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,215 INFO sqlalchemy.engine.base.Engine SELECT CAST('test unicode returns' AS CHAR(60)) AS anon_1
2018-12-27 17:46:54,215 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,216 INFO sqlalchemy.engine.base.Engine SELECT CAST('test collated returns' AS CHAR CHARACTER SET utf8mb4) COLLATE utf8mb4_bin AS anon_1
2018-12-27 17:46:54,216 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,217 INFO sqlalchemy.engine.base.Engine DESCRIBE `user`
2018-12-27 17:46:54,217 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,218 INFO sqlalchemy.engine.base.Engine DESCRIBE `role`
2018-12-27 17:46:54,218 INFO sqlalchemy.engine.base.Engine {}
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
2018-12-27 17:46:54,661 INFO sqlalchemy.engine.base.Engine SHOW VARIABLES LIKE 'sql_mode'
2018-12-27 17:46:54,661 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,663 INFO sqlalchemy.engine.base.Engine SHOW VARIABLES LIKE 'lower_case_table_names'
2018-12-27 17:46:54,663 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,667 INFO sqlalchemy.engine.base.Engine SELECT DATABASE()
2018-12-27 17:46:54,667 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,668 INFO sqlalchemy.engine.base.Engine show collation where `Charset` = 'utf8mb4' and `Collation` = 'utf8mb4_bin'
2018-12-27 17:46:54,668 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,670 INFO sqlalchemy.engine.base.Engine SELECT CAST('test plain returns' AS CHAR(60)) AS anon_1
2018-12-27 17:46:54,670 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,670 INFO sqlalchemy.engine.base.Engine SELECT CAST('test unicode returns' AS CHAR(60)) AS anon_1
2018-12-27 17:46:54,671 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,671 INFO sqlalchemy.engine.base.Engine SELECT CAST('test collated returns' AS CHAR CHARACTER SET utf8mb4) COLLATE utf8mb4_bin AS anon_1
2018-12-27 17:46:54,671 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,672 INFO sqlalchemy.engine.base.Engine DESCRIBE `user`
2018-12-27 17:46:54,672 INFO sqlalchemy.engine.base.Engine {}
2018-12-27 17:46:54,674 INFO sqlalchemy.engine.base.Engine DESCRIBE `role`
2018-12-27 17:46:54,674 INFO sqlalchemy.engine.base.Engine {}
* Debugger is active!
* Debugger PIN: 983-796-441

 

转载于:https://www.cnblogs.com/luke20181010/p/10186642.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值