본문 바로가기
Programming/Python

[ Django ] django-debug-toolbar mime type 에러 해결

by 코뮤(commu) 2022. 2. 25.
728x90
반응형

django-debug-toolbar 를 이용해 SQL 디버깅을 시도하고 있었다.

 

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

 

Installation — Django Debug Toolbar 3.2.4 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

 

공식문서 따라 차근차근 했는데,,,

 

보이라는 사이드 툴바는 뜨지 않고, 위와 같은 에러만 뜬다.

 

 

 

 

해결

 

settings.py 에 아래 코드를 작성한다.

 

mimetypes.add_type("application/javascript", ".js", True)

 

 

mimetypes 모듈은 import 해주면 된다.

.js 확장자를 mimtypes 에 추가해주는 것이다.

 

만약 위 코드를 적용하고 서버를 재시작해도 먹히지 않는다면,

크롬의 강력 새로고침(ctrl+shift+R)을 한번 해보길 바란다.

 

 

 

 

 

제대로 뜬다!

728x90
반응형