为什么跟老师一样的配置,刷新首页之后并不能看到sql日志呢?
都是一些毫无意义的日志
(0.001) None; args=(1,)
(0.000) None; args=(11,)
(0.001) None; args=(11, True, True, '2021-01-13 14:15:41.373616', '2021-01-13 14:15:41.373616')
(0.001) None; args=('jxtj', True, 11)
(0.000) None; args=('jstj', True, 11)
(0.000) None; args=None
(0.002) None; args=None
(0.000) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:42.240301')
(0.002) None; args=(1,)
(0.001) None; args=None
(0.000) None; args=None
(0.000) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:43.259577')
(0.000) None; args=(1,)
(0.017) None; args=(True, 11, 'jszc')
(0.000) None; args=None
(0.000) None; args=None
(0.000) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:44.180117')
(0.001) None; args=(1,)
(0.001) None; args=(True, 11, 'jszc')
(0.001) None; args=(True, 11, 'jszc')
(0.000) None; args=None
(0.000) None; args=None
(0.000) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:44.433439')
(0.001) None; args=(1,)
(0.001) None; args=None
(0.000) None; args=None
(0.003) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:45.235299')
(0.001) None; args=(1,)
(0.001) None; args=('8a326cee56204a45bf6d46e5c66a2438', True)
(0.000) None; args=(1,)
(0.016) None; args=(1, True, True)
(0.001) None; args=(1, True)
(0.008) None; args=('mall', 'product')
(0.005) None; args=(13, 7)
(0.000) None; args=None
(0.001) None; args=None
(0.000) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:46.058100')
(0.001) None; args=(1,)
(0.000) None; args=None
(0.000) None; args=None
(0.001) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:46.237620')
(0.000) None; args=(1,)
(0.000) None; args=None
(0.000) None; args=None
(0.002) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:46.342340')
(0.001) None; args=(1,)
(0.000) None; args=None
(0.002) None; args=None
(0.000) None; args=None
(0.000) None; args=None
(0.002) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:46.368271')
(0.002) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:46.367274')
(0.002) None; args=(1,)
(0.000) None; args=(1,)
(0.000) None; args=None
(0.000) None; args=None
(0.001) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:47.966998')
(0.000) None; args=(1,)
(0.001) None; args=(1,)
(0.001) None; args=('8a326cee56204a45bf6d46e5c66a2438', True, 11)
(0.007) None; args=('8a326cee56204a45bf6d46e5c66a2438', '500ml 52', '500ml 52', '<p><img alt="" src="/medias/201902/product/g11.jpg" /><img alt="" src="/medias/201902/product/g12.jpg" /><img alt="" src="/medias/201902/product/g13.jpg" /><img alt="" src="/medias/201902/product/g14.jpg" /></p>\r\n\r\n<h3><span style="color:#e67e22"><strong></strong></span></h3>', 12, 1, 56.0, '201902/product/g0.jpg', 0, 11, 45, 1, 0, 10.0, '2019-02-27 08:06:17.870061', '2021-01-13 14:15:47.977978', True, 7)
(0.000) None; args=(7,)
(0.002) None; args=(7, 1, 10)
(0.001) None; args=(3, 3.0, 1, 7, '500ml 52', 1, 56.0, '201902/product/g0.jpg', 10, '2021-01-12 06:04:51.369422', '2021-01-13 14:15:47.990935', 12)
(0.000) None; args=None
(0.000) None; args=None
(0.001) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:50.481305')
(0.001) None; args=(1,)
(0.000) None; args=(1,)
(0.001) None; args=(1, 10)
(0.001) None; args=(7,)
(0.001) None; args=None
(0.000) None; args=None
(0.001) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:51.313058')
(0.001) None; args=(1,)
(0.000) None; args=None
(0.000) None; args=None
(0.000) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:52.002218')
(0.001) None; args=(1,)
(0.002) None; args=('8a326cee56204a45bf6d46e5c66a2438', True)
(0.001) None; args=(1,)
(0.001) None; args=(1, True, True)
(0.000) None; args=(1, True)
(0.001) None; args=(13, 7)
(0.001) None; args=None
(0.000) None; args=None
(0.001) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:52.619569')
(0.001) None; args=(1,)
(0.000) None; args=None
(0.001) None; args=None
(0.001) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:52.962655')
(0.001) None; args=(1,)
(0.000) None; args=None
(0.000) None; args=None
(0.002) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:53.188048')
(0.001) None; args=(1,)
(0.001) None; args=None
(0.001) None; args=None
(0.002) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:53.231931')
(0.001) None; args=(1,)
(0.001) None; args=None
(0.002) None; args=None
(0.000) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:53.252875')
(0.001) None; args=(1,)
(0.000) None; args=None
(0.001) None; args=None
(0.000) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:56.631847')
(0.001) None; args=(1,)
(0.001) None; args=(1,)
(0.000) None; args=(1, 10)
(0.001) None; args=(7,)
(0.001) None; args=None
(0.000) None; args=None
(0.001) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:57.364888')
(0.001) None; args=(1,)
(0.001) None; args=None
(0.000) None; args=None
(0.001) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:15:58.850920')
(0.001) None; args=(1,)
(0.001) None; args=None
(0.000) None; args=None
(0.000) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:16:02.889128')
(0.000) None; args=(1,)
(0.000) None; args=(1,)
(0.001) None; args=(1, 10)
(0.001) None; args=(7,)
(0.001) None; args=None
(0.000) None; args=None
(0.001) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:16:03.663060')
(0.001) None; args=(1,)
(0.000) None; args=None
(0.000) None; args=None
(0.002) None; args=None
(0.001) None; args=()
(0.000) None; args=None
(0.001) None; args=None
(0.001) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:17:57.322956')
(0.000) None; args=(1,)
(0.001) None; args=(1,)
(0.002) None; args=(11,)
(0.001) None; args=(11, True, True, '2021-01-13 14:17:57.332940', '2021-01-13 14:17:57.332940')
(0.001) None; args=('jxtj', True, 11)
(0.001) None; args=('jstj', True, 11)
(0.000) None; args=None
(0.000) None; args=None
(0.002) None; args=('0bc5hg2tho0uwzladrae83558bk36xcn', '2021-01-13 14:17:59.009448')
(0.001) None; args=(1,)
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'log_file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': os.path.join(BASE_DIR,'log/debug.txt'),
},
'console': {
'level': 'DEBUG',
# 'filters': ['require_debug_true'],
'class': 'logging.StreamHandler',
# 'formatter': 'simple'
},
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler',
# 'filters': ['special']
}
},
'loggers': {
'django.db.backends': {
'handlers': ['log_file','console'],
'level': 'DEBUG',
'propagate': True,
},
},
}
logger=logging.getLogger('django.db.backends')
def index(request):
# raise Exception
logger.warning('警告信息')
logger.error('报错信息')
15
收起
正在回答 回答被采纳积分+1
1回答
3.从网页搭建入门Python Web
- 参与学习 人
- 提交作业 218 份
- 解答问题 3562 个
本阶段带你用Python开发一个网站,学习主流框架Django+Flask是Python Web开发的第一步,在基础知识上实现积分商城的项目开发,体验真实的项目开发流程,提高解决编程问题和效率的能力。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星