Django-debug-toolbar: Can't figure out how to use intercept redirects

Created on 15 Nov 2015  ·  7Comments  ·  Source: jazzband/django-debug-toolbar

What do I put in my settings.py file so that I can enable this? I know in an earlier version it would step me through the redirects one by one and I'm hoping to reenable that feature.

Documentation

Most helpful comment

On the page, it would really helpful if it explains how you put the actual configurations into your code. For example, when I was trying to solve the redirect problem. On the site, there are two pages that mention it:
https://django-debug-toolbar.readthedocs.org/en/1.4/panels.html?highlight=redirect
and
https://django-debug-toolbar.readthedocs.org/en/1.4/configuration.html#debug-toolbar-config.

The first tells me it's disabled by default and I need to use the DISABLE_PANELS configuration to activate it. So you go to the second page and all it says is that the DISABLE_PANELS is a set of a full paths to panels that are disabled. Nothing on this page (or the other one) tells me what is the actual variable I need to change/set. I tried to create a disable_panels with nothing in it, that didn't work. It doesn't at all imply anywhere that I need to do what I did above. No where is the variable name INTERCEPT_REDIRECTS even listed outside of a changelog that also just says it's now been superseded with this DISABLE_PANELS variable.

For me, the Configuration page would be more helpful if there were examples. You want to enable something like the redirects? Here's an example of how to do so? You want to disable something, then do this. Reading the pages again this morning, I don't actually think my above answer is how I'm _suppose_ to do what I did. I think I'm suppose to be setting something in disable_panels, but I still don't know how.

All 7 comments

See https://django-debug-toolbar.readthedocs.org/en/1.4/configuration.html#debug-toolbar-config.

I'm not going to do your homework, sorry.

I did look through that page originally and I couldn't figure out how to actually use the information supplied. It's not a very useful page as written. However, I did manage to finally dig up an answer (I should've posted here when I did). But I'll post it now in case anyone else also struggles with it.

DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': True,
}

Could you offer a suggestion for improving the wording?

On the page, it would really helpful if it explains how you put the actual configurations into your code. For example, when I was trying to solve the redirect problem. On the site, there are two pages that mention it:
https://django-debug-toolbar.readthedocs.org/en/1.4/panels.html?highlight=redirect
and
https://django-debug-toolbar.readthedocs.org/en/1.4/configuration.html#debug-toolbar-config.

The first tells me it's disabled by default and I need to use the DISABLE_PANELS configuration to activate it. So you go to the second page and all it says is that the DISABLE_PANELS is a set of a full paths to panels that are disabled. Nothing on this page (or the other one) tells me what is the actual variable I need to change/set. I tried to create a disable_panels with nothing in it, that didn't work. It doesn't at all imply anywhere that I need to do what I did above. No where is the variable name INTERCEPT_REDIRECTS even listed outside of a changelog that also just says it's now been superseded with this DISABLE_PANELS variable.

For me, the Configuration page would be more helpful if there were examples. You want to enable something like the redirects? Here's an example of how to do so? You want to disable something, then do this. Reading the pages again this morning, I don't actually think my above answer is how I'm _suppose_ to do what I did. I think I'm suppose to be setting something in disable_panels, but I still don't know how.

I just found out, that you must also empty DISABLE_PANELS key, because by default it contains set(['debug_toolbar.panels.redirects.RedirectsPanel']), so even if you enable INTERCEPT_REDIRECTS=True, nothing happens, because the panel is still disabled. No idea why this is the case.

The INTERCEPT_REDIRECTS setting is gone since https://github.com/jazzband/django-debug-toolbar/commit/603bb47f559b0c99eeb38d77bbb8352b61f68df8, so removing the RedirectsPanel from DISABLE_PANELS should be sufficient now.

The redirect panel appears by default (but is disabled) so I think it is perhaps more discoverable and intuitive than in the past. If there is still confusion on how to use this panel with an update django debug toolbar, please post new details and feel free to reopen.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

clarkbarz picture clarkbarz  ·  8Comments

lfigueira picture lfigueira  ·  10Comments

stfenjobs picture stfenjobs  ·  6Comments

mangobowl picture mangobowl  ·  11Comments

JoshBradshaw picture JoshBradshaw  ·  6Comments