Django debug toolbar not rendering properly

147 Views Asked by At

I'm trying to install the django debug toolbar. It does show up, but it renders really weirdly and doesn't match how I've seen it show up for other developers. Also, when I click on the different panel options, nothing happens. Below is a screen shot of what I'm seeing.

debug toolbar

In settings.py I have the following code:

    DEBUG = True
    INSTALLED_APPS = [..., 'debug_toolbar', ...]
    MIDDLEWARE = ['debug_toolbar.middleware.DebugToolbarMiddleware', ...other middelware]
    DEBUG_TOOLBAR_CONFIG = {
    'SQL_WARNING_THRESHOLD': 100,  # milliseconds
    'SHOW_TOOLBAR_CALLBACK': lambda x: True
    }
    if DEBUG:
        import socket
        hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
        INTERNAL_IPS = [ip[:-1] + "1" for ip in ips] + \
            ['My REMOTE_ADDR', '127.0.0.1']

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

In urls.py, I also have the following:

    if settings.DEBUG:
    urlpatterns += [
        path('__debug__/', include('debug_toolbar.urls')),
    ]

    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)

I'm using version 4.0 of the debug toolbar. Any suggestions?

0

There are 0 best solutions below