django log sql queries

Solutions on MaxInterview for django log sql queries by the best coders in the world

showing results for - "django log sql queries"
Christian
23 Nov 2020
1# Add below code in the settings.py
2
3LOGGING = {
4    'version': 1,
5    'filters': {
6        'require_debug_true': {
7            '()': 'django.utils.log.RequireDebugTrue',
8        }
9    },
10    'handlers': {
11        'console': {
12            'level': 'DEBUG',
13            'filters': ['require_debug_true'],
14            'class': 'logging.StreamHandler',
15        }
16    },
17    'loggers': {
18        'django.db.backends': {
19            'level': 'DEBUG',
20            'handlers': ['console'],
21        }
22    }
23}