django-debug-toolbar
Djago-debug-toolbar은 현재 request/response에 대한 다양한 디버깅 정보를 보여주는 써드파티이다. 다양한 Panel들을 지원하며 SQLPanel을 통해, 각 요청 처리시에 발생한 SQL 내역을 확인할수 있다.
참고로 Ajax 요청에 대한 지원은 불가하다
django-debug-toolbar 설치하기
📒 공식문서 : https://django-debug-toolbar.readthedocs.io/en/latest/
Django Debug Toolbar — Django Debug Toolbar 3.8.1 documentation
© Copyright 2023, Django Debug Toolbar developers and contributors Revision af96d391.
django-debug-toolbar.readthedocs.io
🖥️ 터미널
pip install django-debug-toolbar
🖥️ settings.py
INSTALLED_APPS = [
# ...
"django.contrib.staticfiles",
"debug_toolbar",
# ...
]
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"APP_DIRS": True,
# ...
}
]
MIDDLEWARE = [
# ...
"debug_toolbar.middleware.DebugToolbarMiddleware",
# ...
]
INTERNAL_IPS = [
# ...
"127.0.0.1",
# ...
]
STATIC_URL = "static/"
🖥️ urls.py
from django.urls import include, path
urlpatterns = [
# ...
path('__debug__/', include('debug_toolbar.urls')),
]
📚 django-debug-toolbar 작동 화면
여러 패널들을 통해서, SQL 호출시간과 api 호출내역 등을 확인 등 여러가지 설정들을 확인 할 수 있다.
'FrameWork > Django' 카테고리의 다른 글
django-environ을 이용하여 환경변수 관리하기 (0) | 2023.04.09 |
---|---|
ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'accounts.account', but app 'accounts' doesn't provide model ' 에러 해결 (0) | 2023.04.04 |
mark_safe을 통해 Admin 페이지에서 이미지를 표현하는 방법 (0) | 2023.03.05 |
ERROR : django.db.utils.OperationalError: no such table 오류 해결 (0) | 2023.02.19 |
[Django] 함수 기반 View (0) | 2023.02.08 |