9

Hey, I've been using Django 1.2.1 for some time now and came across Django Debug Toolbar just the other day. It looks really useful and I'm really eager to try some stuff out.

I installed exactly how the readme said. Step by Step. I put the middleware at the end just in case things get caught up but I'm using quite standard middleware (common, sessions, auth and csrf). However, it won't show up on any of my pages. I've tried moving the middleware but to the same effect.

It seems as if I've installed something wrong. But, when I load up the Admin Section of django, the toolbar springs up. I'm not sure what I'm doing wrong. Can the content of my pages effect the toolbar coming up? It's outputting in the mime text/html...

Anyway, any help is greatly appreciated. Thanks in advance.

Here's my Settings.py: pastebin.com/Hu8TgANt

Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
paddymelon
  • 370
  • 2
  • 9
  • Could you edit your question and show us the relevant sections of your settings.py? – markmywords Apr 16 '11 at 08:17
  • 1
    can you post your template? Do you have proper html tags? I think a closing body tag is required for the (default) DDT location. – j_syk Apr 19 '11 at 16:48

8 Answers8

17

Debug toolbar requires that there's at least a closing </body> tag in the response HTML.

This tag can be changed by changing settings.DEBUG_TOOLBAR_CONFIG['INSERT_BEFORE']

http://django-debug-toolbar.readthedocs.org/en/latest/configuration.html#toolbar-options

jaap3
  • 2,696
  • 19
  • 34
4

A few tipps without knowing your code:

  • 'debug_toolbar.middleware.DebugToolbarMiddleware' should be your last or second to last middle ware entry (not 100% sure how it works out with the flatpagefallback middleware)
  • 'debug-toolbar' as last in the list of INSTALLED_APPS
  • Double check if the toolbar's assets are loaded
  • Make sure all toolbar settings are set. (DEBUG_TOOLBAR_CONFIG, INTERNAL_IPS) etc.

The error should be something in there. I know of other problems related getting the toolbar displayed on flatpages so if you only checked on flatpages I suggest you try it on another module.

markmywords
  • 683
  • 5
  • 13
  • 1
    Thanks for your help but, this would lead to a general error I think? Either way, I've triple-checked everything you've mentioned above (I think you mean debug_toolbar in INSTALLED_APPS) and found no errors. I've also just found that redirects are picked up by the toolbar and it shows up then. It must be something in my HTML templates stuffing around... but the toolbar doesn't turn up anywhere, I've checked I'm not hiding it within my HTML somehow... – paddymelon Apr 16 '11 at 09:43
  • Yes, I meant "debug_toolbar" and fixed the typo in my answer. I would like to help you out but I think we (me + and other SO users) need to see the relevant parts of your settings.py and maybe a demo template from your app. – markmywords Apr 16 '11 at 09:50
  • Here's my Settings.py: http://pastebin.com/Hu8TgANt , I'd prefer not to give out some of my templates (I just feel touchy about my source :P) but if there's nothing weird in my settings.py, I guess I'll have to. Thanks so much for the help! (NOTE: obviously is not the actual value in there :P) – paddymelon Apr 17 '11 at 02:40
3

I had the same problem here, and eventually arrived at this post... Anyway, in my case what I noticed was that I had a javascript error in one of my js included libraries. And that breaked the js interpretation flow. When I fixed the javascript error, the django toolbar worked.

That explains why it worked in the admin pages, but not in my app pages.

aldux
  • 2,774
  • 2
  • 25
  • 36
3

Missing INTERNAL_IPS key in settings.py impacts toolbar visibility. Adding this resolves the issue:

INTERNAL_IPS = ('127.0.0.1',)
Forrest Running
  • 103
  • 1
  • 1
  • 6
  • I was running my development off a remote server and had added the server address to the list of IPs but still not working. Putting an assert False in the _show_toolbar method of the middleware allowed me to see where the problem was and identify the IP. – PhoebeB Feb 02 '12 at 12:56
2

In my case, I was using Google Material Design Lite as the frontend framework,

which has the style definition,

*[hidden]{
    display:none!important;
}

this style is applied to Debug Toolbar's elements which result in displaying nothing.

a quick workaround was to change the MDL's style definition (only possible on local stylesheets, not with cdn hosted) to

*[hidden]{
    display:none;
}
1

I had a similar issue. The solution was closing a div as a non-empty HTML element.

From this

<body>
...
    <div id="map-canvas"/>
...
</body>

to this

<body>
...
    <div id="map-canvas"></div>
...
</body>

Hope it helps!

Agustín
  • 1,569
  • 1
  • 14
  • 9
0

In my case the error was very simple.

I removed the footer and it worked like a charm!

Hope this solves an issue for somebody else.

Gustavo Reyes
  • 1,313
  • 1
  • 17
  • 31
0

In my case the solution was to hard-refresh my webpage. Simply hit Ctrl+F5 and that's it

cable2360
  • 1
  • 1