flask-debugtoolbar icon indicating copy to clipboard operation
flask-debugtoolbar copied to clipboard

UserWarning: Could not insert debug toolbar. </body> tag not found in response.

Open mrsan22 opened this issue 7 years ago • 9 comments

Hi Team, I am using Flask(0.12.2) with Angular(v6) as front-end framework. I did the setup of the toolbar as described in the documentation. However, the toolbar is not showing up when I load the app. I am getting following warning:

UserWarning: Could not insert debug toolbar. </body> tag not found in response. warnings.warn('Could not insert debug toolbar.' Does the non-appearance of the debug toolbar has to do with the front-end framework I am using (Angular)? Let me know if you need more info here. Thanks!

mrsan22 avatar Jun 15 '18 20:06 mrsan22

I meet the same problem! Hope the team can deal with it!

TzeSing avatar Jul 20 '18 07:07 TzeSing

Facing the same issue

ajinkyapuar avatar Aug 28 '18 06:08 ajinkyapuar

same here. Just a warning in version 0.10.1 but I was wondering if there is a fix?

dmitrypol avatar Aug 23 '19 13:08 dmitrypol

I suspect all of you are trying to use debug toolbar with JSON based responses, not HTML based responses, yes?

Debug toolbar works only when rendering html pages from flask.

idchlife avatar Sep 07 '19 23:09 idchlife

Note to self: Add DEBUG-level logging of the response, that way it'd be easy to see what's actually getting returned...

jeffwidman avatar Mar 09 '20 17:03 jeffwidman

I'm using Htmx library which uses AJAX that returns html in the background which it then uses to updates the DOM. It's not really a problem but would it be possible to add a decorator or config option to list endpoints for debugtoolbar to ignore?

extant1 avatar Aug 22 '20 21:08 extant1

HTMX user here as well. FWIW, django_debugtoolbar offers a mechanism to turn OFF debugToolbar on specified routes (for example, HTMX calls that are still returning clean HTML, just not total pages) using the SHOW_TOOLBAR_CALLBACK variable (see https://stackoverflow.com/a/75813120/635040 for an example)

Minimally, would still be nice to be able to mute the "body tag not found" warning!

PBorocz avatar Jan 27 '24 00:01 PBorocz

Why was #125 marked as a duplicate of this? https://github.com/pallets-eco/flask-debugtoolbar/issues/159#issuecomment-2088444680

The requests seem to be different. Unless you're looking at this? https://github.com/pallets-eco/flask-debugtoolbar/issues/125#issuecomment-678695735

Either way, the ability to toggle per endpoint is such a critical feature.

acbart avatar Sep 10 '24 18:09 acbart

My impression is that we'd consider them duplicates because they're two requests (albeit for different motivations or use cases) that end up asking for the same thing - a way to turn off the toolbar on specific routes. While they may be different, I'd argue that they have the same solution, so tracking them together makes sense.

macnewbold avatar Sep 11 '24 18:09 macnewbold