zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    HTML5移动开发修改APP名称
    JS保留字
    基于MVC的JagaScript Web 富应用开发
    继承的另一种写法
    设置MIME使虚拟空间可以下载APK文件
    HTML5移动开发修改APP图标
    Acer Travelmate T3290笔记本拆机指南
    SQL语法用like %或in时Parameters要怎么用才能避免SQL Injection的问题
    DirectShow编译过程(转载+修改)
    webclient很好很强大
  • 原文地址:https://www.cnblogs.com/luke20181010/p/10186642.html
Copyright © 2011-2022 走看看