본문 바로가기
개발일지/Django

Django -django-debug-toolbar 설치 및 활용 문제 해결!

by 개발에정착하고싶다 2023. 1. 9.

#1 개요

 

음... 우선

django-debug-toolbar는

장고를 배포하기 전 혹은 DEBUG 옵션이 True인 동안에 toolbar로 문제를 체크하는 기능이다.


#2 설치방법

 

설치는

https://django-debug-toolbar.readthedocs.io/en/latest/installation.html

 

Installation — Django Debug Toolbar 3.8.1 documentation

Troubleshooting On some platforms, the Django runserver command may use incorrect content types for static assets. To guess content types, Django relies on the mimetypes module from the Python standard library, which itself relies on the underlying platfor

django-debug-toolbar.readthedocs.io

이 공식문서에 나와있는 것 중에서

깃허브의 내용을 끌고오라는 것을 제외하고 모두 진행하였다.

 

하지만 내가 원하는 debug 툴바가 오른쪽 상단에 뜨지 않는것이다;

이렇게 말이다.

 

그래서 settings의 내용도 꼼꼼히 보고, 보고 다시보고를 반복했다.


#3 결론

 

혹시나 하는 마음에 아예 공식문서의 내용을 복붙하기 시작했다.

혹시나는 역시나 들어맞았고,

마지막에 세팅해줘야하는 인터널 ips에 대해서

INTERNER_IPS = ['127.0.0.1']

이렇게 설정해주었기에 작동이 안되었었다.

INTERNAL_IPS = [
    # ...
    "127.0.0.1",
    # ...
]

이게 답안코드고 NAL을 NER로 써주었기에 작동이 안되던 거였다.

결국 오타를 잡아주었더니 정상 작동 되기 시작했다.