Python中Flask框架SQLALCHEMY_ECHO设置

2018-12-28 08:04:51来源:博客园 阅读 ()

新老客户大回馈,云服务器低至5折

在用配置类的方式给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

 

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:python读取txt天气数据并使用matplotlib模块绘图

下一篇:python基础篇-输入和输出