I am trying a lot to appear Debug-tool but it doesn't appear.
First I installed it using pipenv:
pipenv install django-debug-toolbar
Here settings.py:
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"rest_framework",
"BookListAPI",
"debug_toolbar", # added debug-tool here
]
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
'debug_toolbar.middleware.DebugToolbarMiddleware', # added debug_toolbar.middleware
]
# added INTERNAL_IPS
INTERNAL_IPS = [
'127.0.0.1',
]
urls.py:
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path("admin/", admin.site.urls),
path("api/", include('BookListAPI.urls')),
path("__debug__/", include('debug_toolbar.urls')),
]
I don't know why debug-tool doesn't appear.
"The order of MIDDLEWARE is important. You should include the Debug Toolbar middleware as early as possible in the list. However, it must come after any other middleware that encodes the response’s content, such as GZipMiddleware."