DJDT Not Showing, loaded in source

Having some issues with DJDT not showing on my project. I’ve followed the instructions both in video and from DJDT. If I view source, it’s loaded in but just not showing.

I was able to get it to show in a different browser yesterday, but on re-starting project it’s not showing in any now.

Settings.py:

INSTALLED_APPS = [
‘django.contrib.admin’,
‘django.contrib.auth’,
‘django.contrib.contenttypes’,
‘django.contrib.messages’,
‘django.contrib.staticfiles’,
‘playground’,
‘debug_toolbar’,
]

MIDDLEWARE = [
‘debug_toolbar.middleware.DebugToolbarMiddleware’,

INTERNAL_IPS = [
“127.0.0.1”,
]

urls.py:

path('__debug__/', include('debug_toolbar.urls')),

Any help would be greatly appreciated, I’m at wit’s end.

1 Like

Looking over the installation docs, in step 2. Check for Prerequisites, did you set:

TEMPLATES = [
    {
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "APP_DIRS": True,
        # ...
    }
]

The TEMPLATES in your settings.py file should look like this:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

Source:
https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#check-for-prerequisites

1 Like

Sorry for the late reply, and thank you for your help.

I did have my settings set that way, but was still unable to progress. Since I had abandoned this and took another course, I was able to better debug this myself, so for anyone having issues.

SOLUTION:

In your settings.py file, add the following:

#settings.py
if DEBUG:
    import mimetypes
    mimetypes.add_type("application/javascript", ".js", True)

After this you’ll need a wipe in browser settings, or just open an incognito tab.

1 Like