django-debug-toolbar not showing up

django debug toolbar not showing docker
remove django debug toolbar
'djdt' is not a registered namespace
django debug toolbar in production
django debug toolbar performance
django debug toolbar changelog
django debug toolbar panels
django debug panel

I looked at other questions and can't figure it out...

I did the following to install django-debug-toolbar:

  1. pip install django-debug-toolbar
  2. added to middleware classes:
MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    # Uncomment the next line for simple clickjacking protection:
    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'debug_toolbar.middleware.DebugToolbarMiddleware',
)

3 Added INTERNAL_IPS:

INTERNAL_IPS = ('174.121.34.187',)

4 Added debug_toolbar to installed apps

I am not getting any errors or anything, and the toolbar doesn't show up on any page, not even admin.

I even added the directory of the debug_toolbar templates to my TEMPLATE_DIRS

Stupid question, but you didn't mention it, so... What is DEBUG set to? It won't load unless it's True.

If it's still not working, try adding '127.0.0.1' to INTERNAL_IPS as well.

UPDATE

This is a last-ditch-effort move, you shouldn't have to do this, but it will clearly show if there's merely some configuration issue or whether there's some larger issue.

Add the following to settings.py:

def show_toolbar(request):
    return True
SHOW_TOOLBAR_CALLBACK = show_toolbar

That will effectively remove all checks by debug toolbar to determine if it should or should not load itself; it will always just load. Only leave that in for testing purposes, if you forget and launch with it, all your visitors will get to see your debug toolbar too.

For explicit configuration, also see the official install docs here.

EDIT(6/17/2015):

Apparently the syntax for the nuclear option has changed. It's now in its own dictionary:

def show_toolbar(request):
    return True
DEBUG_TOOLBAR_CONFIG = {
    "SHOW_TOOLBAR_CALLBACK" : show_toolbar,
}

Their tests use this dictionary.

Cannot get django-debug-toolbar to appear, Does anyone have any suggestions for debugging? I'm running OSX and Django 1.7. The curious thing is that debug-toolbar WAS appearing just  Django toolbar not showing up. Ask Question Asked 7 years, 10 months ago. Active 5 years, django-debug-toolbar not showing up. 83. Cannot display HTML string. 0.

Debug toolbar wants the ip address in request.META['REMOTE_ADDR'] to be set in the INTERNAL_IPS setting. Throw in a print statement in one of your views like such:

print("IP Address for debug-toolbar: " + request.META['REMOTE_ADDR'])

And then load that page. Make sure that IP is in your INTERNAL_IPS setting in settings.py.

Normally I'd think you would be able to determine the address easily by looking at your computer's ip address, but in my case I'm running the server in a Virtual Box with port forwarding...and who knows what happened. Despite not seeing it anywhere in ifconfig on the VB or my own OS, the IP that showed up in the REMOTE_ADDR key was what did the trick of activating the toolbar.

Fix: Django Debug Toolbar not showing when using with Docker , Fix: Django Debug Toolbar not showing when using with Docker. - option1.py. Hey @rhonaldmoses take a look in a more up to date code: INSTALLED_APPS  Django debug toolbar not showing up. 0 I've installed debug toolbar properly. It;s in my sys.path , i've added it to the middleware_classes , to the installed apps

If everything else is fine, it could also be that your template lacks an explicit closing <body> tag—

Note: The debug toolbar will only display itself if the mimetype of the response is either text/html or application/xhtml+xml and contains a closing tag.

Django Toolbar not showing at all from upgrade to 1.9.1 -> 2.0 , Using: Django==2.2 django-debug-toolbar==2.0 I have gone through the changelog and none of Django Toolbar not showing at all from upgrade to 1.9.​1 -> 2.0 #1197 Sign up for free to join this conversation on GitHub. I was suprised that the IP address required was loopback 127.0.0.1. When I added that to my settings.py file, the django-debug-toolbar showed up. I immediately reverted back my settings.py file, because I didn't want the whole world to be able to view all my debug toolbar panels.

The current stable version 0.11.0 requires the following things to be true for the toolbar to be shown:

Settings file:

  1. DEBUG = True
  2. INTERNAL_IPS to include your browser IP address, as opposed to the server address. If browsing locally this should be INTERNAL_IPS = ('127.0.0.1',). If browsing remotely just specify your public address.
  3. The debug_toolbar app to be installed i.e INSTALLED_APPS = (..., 'debug_toolbar',)
  4. The debug toolbar middleware class to be added i.e. MIDDLEWARE_CLASSES = ('debug_toolbar.middleware.DebugToolbarMiddleware', ...). It should be placed as early as possible in the list.

Template files:

  1. Must be of type text/html
  2. Must have a closing </html> tag

Static files:

If you are serving static content make sure you collect the css, js and html by doing:

./manage.py collectstatic 

Note on upcoming versions of django-debug-toolbar

Newer, development versions have added defaults for settings points 2, 3 and 4 which makes life a bit simpler, however, as with any development version it has bugs. I found that the latest version from git resulted in an ImproperlyConfigured error when running through nginx/uwsgi.

Either way, if you want to install the latest version from github run:

pip install -e git+https://github.com/django-debug-toolbar/django-debug-toolbar.git#egg=django-debug-toolbar 

You can also clone a specific commit by doing:

pip install -e git+https://github.com/django-debug-toolbar/django-debug-toolbar.git@ba5af8f6fe7836eef0a0c85dd1e6d7418bc87f75#egg=django_debug_toolbar

django-debug-toolbar is driving me insane. Absolutely insane!, Absolutely insane! Hello. I just tried setting up django-debug-toolbar but it just will not show up  Be aware of middleware ordering and other middleware that may intercept requests and return responses. Putting the debug toolbar middleware after the Flatpage middleware, for example, means the toolbar will not show up on flatpages. Browsers have become more aggressive with caching static assets, such as JavaScript and CSS files.

I tried everything, from setting DEBUG = True, to settings INTERNAL_IPS to my client's IP address, and even configuring Django Debug Toolbar manually (note that recent versions make all configurations automatically, such as adding the middleware and URLs). Nothing worked in a remote development server (though it did work locally). The ONLY thing that worked was configuring the toolbar as follows:

DEBUG_TOOLBAR_CONFIG = {
    "SHOW_TOOLBAR_CALLBACK" : lambda request: True,
}

This replaces the default method that decides if the toolbar should be shown, and always returns true.

Installation, pip install -e git+https://github.com/jazzband/django-debug-toolbar.git#egg=​django-debug- Make sure that 'django.contrib.staticfiles' is set up properly and add You can change the logic of determining whether or not the Debug Toolbar  I just tried setting up django-debug-toolbar but it just will not show up. I went over everything 100000 times, but it just will not show up. I'm about to explode, so I need to ask for some help. My Django version is 2.1, everything is up to date. I'm using the runserver in Debug mode. Here's what I did: Set Debug to True

Django debug toolbar not displayed using docker-compose, Django debug toolbar not displayed using docker-compose. Jean-Loup Adde I go inside the docker folder and run docker-compose up . This command will  Django Debug Toolbar. The Django Debug Toolbar is a configurable set of panels that display various debug information about the current request/response and when clicked, display more details about the panel's content.

django-debug-toolbar not showing up, django-debug-toolbar not showing up. I looked at other questions and can't figure it out I did the following to install django-debug-toolbar: pip install  Django Debug Toolbar; Edit on GitHub; Django Debug Toolbar¶ Installation. Getting the code; Prerequisites; Setting up URLconf; Enabling middleware; Configuring

django-debug-toolbar · PyPI, The Django Debug Toolbar is a configurable set of panels that display the Flatpage middleware, for example, means the toolbar will not show up on flatpages. Setting up URLconf¶ Add the Debug Toolbar’s URLs to your project’s URLconf as follows: from django.conf import settings from django.conf.urls import include , url # For django versions before 2.0 from django.urls import include , path # For django versions from 2.0 and up if settings .

Comments
  • If you're using Vagrant, make sure that your INTERNAL_IPS is correct. One way to check is in a view, print your request.META['REMOTE_ADDR'], then add that to your INTERNAL_IPS.
  • This might help somebody. I was trying by adding '*' in the internal IPs, but that does not work. You have to enter specific IPs.
  • In my settings.py, it's now MIDDLEWARE only, not MIDDLEWARE_CLASSES
  • Yeah, so there's some larger issue going on here. If you're using something other than runserver make sure you restart it. Heck, restart runserver, too. Make sure your changes to settings.py actually got saved/commited. You might want to try removing *.pyc files. In *nix, you can do that simply with find . -name "*.pyc" -exec rm {} \; from the project root. Finally, run python manage.py shell and execute from django.conf import settings and check the value of settings.INSTALLED_APPs.
  • I'm not sure what you mean with the last question, but if you're referring to INTERNAL_IPS, those are for the client not the server (Django). In other words, you put in your IP address so you can see debug toolbar, no matter what IP the site may be running on.
  • INTERNAL_IPS got me aswell.. Thanks for the info
  • or even SHOW_TOOLBAR_CALLBACK = lambda x: True
  • @schillingt yes, apologies I should've checked this. I think I had to run collectstatic to make everything appear.
  • I was getting to my page via nginx proxy pass through so the remote_addr was my proxy and not my real ip. I needed to add my proxy ip address to INTERNAL_IPS and it started working.
  • From my guest machine in VirtualBox, my host machine is seen as 10.0.0.2, if it can help someone. :)
  • VERY useful to CHECK IP if you use some virtualization like VAGRANT
  • In docker my REMOTE_ADDR was not what I would have assumed.
  • DUUUUUUUUUUUUDDE. Snoochie booches.
  • actually its <body></body> tag which is necessary not </html>