# Django Debug Toolbar not showing up

**URL:** <https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092>\
**Category:** Getting Started\
**Created:** [June 2, 2022, 7:13pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092 "2022-06-02T19:13:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [June 2, 2022, 7:13pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/1 "2022-06-02T19:13:49Z")

</div>

My Django Debug Toolbar is not showing up. I hope you can help:  
[https://github.com/qvisty/DjangoPro40](https://github.com/qvisty/DjangoPro40)

My .env contains this (and more, not shown):

```auto
DJANGO_DEBUG=True

```

I’m trying to follow Django for Professionals by Will Vincent, but I cant get this part to work… ☹  
Great book - I can recommend it very much

---

<div class="post-metadata">

**Author:** ![CodenameTim](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/codenametim/32/31507_2.png) [@CodenameTim](https://forum.djangoproject.com/u/CodenameTim)\
**Post date:** [June 2, 2022, 7:58pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/2 "2022-06-02T19:58:16Z")

</div>

The [docs have some tips](https://django-debug-toolbar.readthedocs.io/en/latest/tips.html#the-toolbar-isn-t-displayed). Give those a go and let us know what the results are.

---

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [June 2, 2022, 7:59pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/3 "2022-06-02T19:59:31Z")

</div>

I tried those, but in case I missed something I posted here.

---

<div class="post-metadata">

**Author:** ![CodenameTim](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/codenametim/32/31507_2.png) [@CodenameTim](https://forum.djangoproject.com/u/CodenameTim)\
**Post date:** [June 2, 2022, 8:02pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/4 "2022-06-02T20:02:44Z")

</div>

Your repo is currently private. That will need to be made public if you want us to review the code. Otherwise, you can let us know what you’ve tried. Share your installed apps, middleware, toolbar settings, and whether the toolbar is being injected into the HTML, but not shown or if it’s not being injected at all. Other questions: are you using docker, are you using channels, did the toolbar show up when you browse to the admin?

---

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [June 2, 2022, 8:26pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/5 "2022-06-02T20:26:32Z")

</div>

Private. Sorry 🙃.  
Should be public now

---

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [June 2, 2022, 8:28pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/6 "2022-06-02T20:28:01Z")

</div>

> [@CodenameTim](#):
>
> Other questions: are you using docker, are you using channels, did the toolbar show up when you browse to the admin?

Wow. I will answer those tomorrow when on pc. (bedtime in my pytz​😉)

---

<div class="post-metadata">

**Author:** ![CodenameTim](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/codenametim/32/31507_2.png) [@CodenameTim](https://forum.djangoproject.com/u/CodenameTim)\
**Post date:** [June 2, 2022, 9:11pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/7 "2022-06-02T21:11:05Z")

</div>

Another question, are you running this locally?

---

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [June 3, 2022, 4:45am UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/8 "2022-06-03T04:45:23Z")

</div>

> [@CodenameTim](#):
>
> locally

Yes. I tried manually entering the adress in internal\_ips

---

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [June 4, 2022, 7:54am UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/9 "2022-06-04T07:54:29Z")

</div>

In settings.py I tried the following:

Trying all different options I could think of for  
INTERNAL\_IPS = [127.0.0.1]  
INTERNAL\_IPS = [‘127.0.0.1’]  
INTERNAL\_IPS = [127.0.0.1,]  
INTERNAL\_IPS = [‘127.0.0.1’,]

Moving “debug\_toolbar.middleware.DebugToolbarMiddleware”, up and down in the MIDDLEWARE.

Change debug = True instead of DEBUG = env.bool(“DJANGO\_DEBUG”)

I made sure it is in installed apps.

This is my allowed hosts setting: ALLOWED\_HOSTS = [".herokuapp.com", “localhost”, “127.0.0.1”]  
Not sure if that makes a difference.

I restarted the server.

No more ideas.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [June 4, 2022, 12:15pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/10 "2022-06-04T12:15:38Z")

</div>

> [@qvisty](#):
>
> > [@CodenameTim](#):
> >
> > Other questions: are you using docker, are you using channels, did the toolbar show up when you browse to the admin?
> 
> Wow. I will answer those tomorrow when on pc. (bedtime in my pytz​😉)

Answers to these question?

If you’re using “localhost” as the address in your browser address bar, you might want to add _it_ to INTERNAL\_IPS.

Also, you’re showing an external name in ALLOWED\_HOSTS - are you running this in heroku? If so, you need to add _your_ public-facing IP address to INTERNAL\_IPS - and, depending upon your ISP and heroku, it might be an IPv6 address as well. (The INTERNAL\_IPS list is checking for the `REMOTE_ADDR` header in the request - it’s verifying that the browser making the request is in that list. Check your server log to see what is showing as the IP address making the requests.)

---

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [June 4, 2022, 1:31pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/11 "2022-06-04T13:31:35Z")

</div>

Thank you guys. I will try to answer all your specific questions when I am able tofind pc time. 😁  
Ill be back…

---

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [June 5, 2022, 7:45pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/12 "2022-06-05T19:45:30Z")

</div>

> [@CodenameTim](#):
>
> Share your installed apps, middleware, toolbar settings, and whether the toolbar is being injected into the HTML, but not shown or if it’s not being injected at all. Other questions: are you using docker, are you using channels, did the toolbar show up when you browse to the admin?

Just to recap. I am really wondering why it does not work as I am following Will’s book Django for Professionals, but I am skipping the Docker and testing part (this time round). Maybe this will affect it.

installed apps:

````auto
INSTALLED_APPS = [
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    "django.contrib.sites",
    # Third-party
    "crispy_forms",
    "crispy_bootstrap5",
    "allauth",
    "allauth.account",
    "debug_toolbar",
    # Local
    "accounts.apps.AccountsConfig",
    "pages.apps.PagesConfig",
    "books.apps.BooksConfig",
]```
middleware:

````

MIDDLEWARE = [  
“django.middleware.security.SecurityMiddleware”,  
“django.contrib.sessions.middleware.SessionMiddleware”,  
“django.middleware.common.CommonMiddleware”,  
“django.middleware.csrf.CsrfViewMiddleware”,  
“django.contrib.auth.middleware.AuthenticationMiddleware”,  
“debug\_toolbar.middleware.DebugToolbarMiddleware”,  
“django.contrib.messages.middleware.MessageMiddleware”,  
“django.middleware.clickjacking.XFrameOptionsMiddleware”,  
]```  
toolbar settings:

```auto
# django-debug-toolbar
import mimetypes

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

hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS = [ip[:-1] + "1" for ip in ips]

```

docker and channels:  
both no

show up in the admin:  
no

---

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [June 5, 2022, 7:47pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/13 "2022-06-05T19:47:33Z")

</div>

> [@KenWhitesell](#):
>
> If you’re using “localhost” as the address in your browser address bar, you might want to add _it_ to INTERNAL\_IPS.

I am using this code from Will’s book:

```auto
# django-debug-toolbar
import mimetypes

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

hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS = [ip[:-1] + "1" for ip in ips]

```

> [@KenWhitesell](#):
>
> Also, you’re showing an external name in ALLOWED\_HOSTS - are you running this in heroku?

No not yet. The heroku-code is because one of the follow chapters is “Deploy”

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [June 5, 2022, 8:04pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/14 "2022-06-05T20:04:32Z")

</div>

> [@qvisty](#):
>
> I am using this code from Will’s book:

That code appears to also be what is documented here: [Installation — Django Debug Toolbar 4.2.0 documentation](https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#configure-internal-ips), which applies to a Docker-based installation. Since you’re not using Docker, I don’t think it would apply.

> [@KenWhitesell](#):
>
> If you’re using “localhost” as the address in your browser address bar, you might want to add _it_ to INTERNAL\_IPS.

And again - this is asking for what you are entering in your address bar in your browser to go to your site.

When testing your site, do you use:

- `http://127.0.0.1/`
- `http://localhost/`
- `http://something-else/` (non-local address)

What you want to look at is your server logs - specifically, what is being received as the `REMOTE_ADDR` header in the http request. The easiest thing to do to identify this is to throw a print statement to print that header in a view and see what you’re getting.  
Whatever you’re getting is what needs to be in your INTERNAL\_IPS list.

---

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [June 5, 2022, 8:15pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/15 "2022-06-05T20:15:18Z")

</div>

> [@KenWhitesell](#):
>
> When testing your site, do you use:
> 
> - `http://127.0.0.1/`

This option, yes. 🙂

> [@KenWhitesell](#):
>
> What you want to look at is your server logs

I dont think I have any server logs? I tried looking in the developer console in the browser but could not find the remote\_adr…

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [June 5, 2022, 8:28pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/16 "2022-06-05T20:28:43Z")

</div>

> [@qvisty](#):
>
> > [@KenWhitesell](#):
> >
> > When testing your site, do you use:
> > 
> > - `http://127.0.0.1/`
> 
> This option, yes. 🙂

Then yes, your INTERNAL\_IPS should include an entry for ‘127.0.0.1’. (It’s a string, not a number, so must be enclosed in quotes.)

I saw where you said that you had tried this before, so I’m now willing to rule this out as the likely cause of the issue you’re facing, pending verification of the `REMOTE_ADDR` header. (And based on your logging comment, a print statement in a view may be the easiest way to verify it. You could also look at the network tab in your browser’s developer tools to see the request.)

From the docs at [Installation — Django Debug Toolbar 4.2.0 documentation](https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#add-the-middleware), you might want to move the middleware to the top of the list.

Actually, I was just reminded you posted a link to the entire project - I’m going to pull a copy to see what happens here…

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [June 5, 2022, 8:55pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/17 "2022-06-05T20:55:39Z")

</div>

Well, I hate to say it, but your project works for me exactly as posted in git - making three trivial changes. (Changed the database to match a test database I created for this, set `DEBUG=True` rather than an environment variable, and set `INTERNAL_IPS = ['127.0.0.1']`), and this is what I get:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/5/59479f2e4c7f98ce797ee26477a9c1cb02a3a06d.png)

---

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [June 6, 2022, 7:49pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/18 "2022-06-06T19:49:01Z")

</div>

> [@KenWhitesell](#):
>
> Well, I hate to say it

I’ll try this and see where it breaks when I try to “get it back”. 🙂

---

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [June 12, 2022, 5:19pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/19 "2022-06-12T17:19:44Z")

</div>

I changed my database to original django sqlite code.  
I changed internal\_ip as you demonstrated above.  
I move debug\_toolbar middleware to the top of the list.

… Still not showing up.  
I am giving up on this and move on in the book. I will give this an other try some time later.  
Thank you all for helping.

---

<div class="post-metadata">

**Author:** ![learninguser](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/learninguser/32/14325_2.png) [@learninguser](https://forum.djangoproject.com/u/learninguser)\
**Post date:** [June 19, 2023, 3:01pm UTC](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092/20 "2023-06-19T15:01:14Z")

</div>

Hi,

Have you checked once in the Developer Console of your browser? In my case I had a MIME Type error on Windows. To be exact:

> Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “text/plain”. Strict MIME type checking is enforced for module scripts per HTML spec.

To solve this, I had add the following lines of code to my project settings.py.

```auto
if DEBUG:
    import mimetypes
    mimetypes.add_type("application/javascript", ".js", True)

```

Hope this solves your issue.

Kind regards  
Pavan Kumar Akula.

[Next page](https://forum.djangoproject.com/t/django-debug-toolbar-not-showing-up/14092.md?page=2)
