이유를 알기 힘든 오류를 해결할때 터미널에서 sql 쿼리를 보면서 해결할 수 있다.!
# 콘솔창에서 SQL 쿼리 보기
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"level": "DEBUG",
"class": "logging.StreamHandler",
},
},
"loggers": {
"django.db.backends": {
"handlers": ["console"],
"level": "DEBUG",
},
},
}
어떤 부분에서 어떤 요청이 들어가고 있는지 확인 가능,
예를들어 다른요청이 같은 api요청에 들어가고 있는 경우를 확인, 수정하기가 가능하다!
https://bio-info.tistory.com/173
[Django] SQL 쿼리 로그 확인하기 (feat. 콘솔창)
# 콘솔창에서 SQL 쿼리 보기 LOGGING = { "version": 1, "disable_existing_loggers": False, "handlers": { "console": { "level": "DEBUG", "class": "logging.StreamHandler", }, }, "loggers": { "django.db.backends": { "handlers": ["console"], "level": "DE
bio-info.tistory.com
'AI 웹개발반 > Python, Django' 카테고리의 다른 글
[Django] QuerySet 메서드와 filter option (0) | 2023.06.29 |
---|---|
[Django] datetime을 활용해 시간 비교하기 (0) | 2023.06.27 |
[DRF] serializer field옵션 | serializer에 필드 추가, 변경하기 (0) | 2023.06.22 |
[TIL] django cron / crontab (0) | 2023.06.13 |
[DRF + JS] 비디오와 미디어를 넣은 게시글 생성하기 ***수정중 (0) | 2023.05.15 |