Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mrsan22 opened this issue Jun 15, 2018 · 9 comments

Comments

@mrsan22
Copy link

mrsan22 commented Jun 15, 2018

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!

@TzeSing
Copy link

TzeSing commented Jul 20, 2018

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

@ajinkyapuar
Copy link

Facing the same issue

@dmitrypol
Copy link

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

@idchlife
Copy link

idchlife commented Sep 7, 2019

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.

@jeffwidman
Copy link
Member

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

@extant1
Copy link

extant1 commented Aug 22, 2020

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?

@PBorocz
Copy link

PBorocz commented Jan 27, 2024

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!

@acbart
Copy link

acbart commented Sep 10, 2024

Why was #125 marked as a duplicate of this? #159 (comment)

The requests seem to be different. Unless you're looking at this? #125 (comment)

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

@macnewbold
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

10 participants