1

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.

  • Have you verified that your project meets the prerequisites? https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#check-for-prerequisites – Matheus Simão Caixeta Dec 16 '22 at 20:06
  • Does this answer your question? [django-debug-toolbar not showing up](https://stackoverflow.com/questions/10517765/django-debug-toolbar-not-showing-up) – Javad Dec 16 '22 at 20:52
  • Yes, I tried all answers to the other questions, but debug toolbar still doesn't show up. – Omnia Osman Dec 17 '22 at 10:19

1 Answers1

0

"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."

Serguei A
  • 334
  • 1
  • 2
  • 10