Django 终端打印SQL语句

讲一下配置写到 settings.py内即可

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

猜你喜欢

转载自www.cnblogs.com/bladecheng/p/11354220.html
今日推荐