码迷,mamicode.com
首页 > 数据库 > 详细

6.让ORM映射执行的时候打印SQL语句

时间:2017-03-04 15:29:57      阅读:298      评论:0      收藏:0      [点我收藏+]

标签:isa   debug   tin   技术分享   http   com   level   end   nbsp   

配置Django日志:\hello_django\hello_django\settings.py 文件中的 LOGGING 

 

加入如下配置:

LOGGING = {
  ‘version‘: 1,
  ‘disable_existing_loggers‘: False,
  ‘handlers‘: {
    ‘console‘:{
      ‘level‘:‘DEBUG‘,
      ‘class‘:‘logging.StreamHandler‘,
    },
  },
  ‘loggers‘: {
    ‘django.db.backends‘: {
      ‘handlers‘: [‘console‘],
      ‘propagate‘: True,
      ‘level‘:‘DEBUG‘,
    },
  }
}

 

技术分享

技术分享

 

6.让ORM映射执行的时候打印SQL语句

标签:isa   debug   tin   技术分享   http   com   level   end   nbsp   

原文地址:http://www.cnblogs.com/413xiaol/p/6501348.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!