본문 바로가기
AI 웹개발반/Python, Django

[django] 오류를 해결할때

by 째깍단 2023. 6. 23.

이유를 알기 힘든 오류를 해결할때 터미널에서 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