django-debug-toolbar icon indicating copy to clipboard operation
django-debug-toolbar copied to clipboard

'debug_toolbar' loads in small iframe

Open normoes opened this issue 4 years ago • 3 comments

The issues I have are:

  • The debug_toolbar is shown outside the iFrame AND within. So, I have two of them. The iFrame is very small, so the toolbar does not make any sense in there.
  • The outer debug_toolbar contains no SQL queries, it just says: No SQL queries were recorded during this request.. Also no cache..
  • The inner one shows the SQLs and caches correctly.

I could hide the inner one, but then I am missing the SQLs.

What can I do? Are there any options?

It seems like the outer toolbar is missing the backends.

normoes avatar Sep 03 '20 12:09 normoes

I have included debug_toolbar to the INSTALLED_APPS.

And I tried to add 'debug_toolbar.middleware.DebugToolbarMiddleware', to every possible location in MIDDLEWARE.

normoes avatar Sep 03 '20 12:09 normoes

I'm assuming you have an application built in which the front-end loads an iframe where both the parent and the iframe are using the same django application for the backend. If that's true, I can think of two options (there are likely more):

  1. Start two runserver processes on different ports, have the parent and iframe hit different processes. This should allow you to use the toolbar for both.
  2. Manipulate the config setting SHOW_TOOLBAR_CALLBACK so that it only shows the toolbar for the iframe portion or the parent window portion depending on your needs.

tim-schilling avatar Sep 03 '20 14:09 tim-schilling

I agree with Tim's suggestions. There isn't a bug in Debug Toolbar, but a need for further configuration to meet your unique needs. I'm open to contributions that add docs that provide examples of how to work with iframes. But beyond that, I don't think there is anything to fix.

jdufresne avatar Sep 27 '20 14:09 jdufresne

Closing due to lack of response.

tim-schilling avatar Aug 29 '22 01:08 tim-schilling