-
Notifications
You must be signed in to change notification settings - Fork 1.1k
History sidebar panel keeps loading infinitely? #1961
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
Comments
You'll need to provide more information. I can see you're using Django 4.2.14. Please provide:
I suspect what's happening is that the history panel isn't recognizing the request to the toolbar view as an toolbar request, then includes it in the history panel, which then causes it to refresh by making another request. |
Hey, normally I don't use any extra stuff with the toolbar, but I've ensured that I update to the latest version to make sure it's not something that's already fixed. So,
The only extra I use in the toolbar settings is: No extra JS settings, but the project is pretty huge. I've tested with multiple sub-pages, even pretty simple ones to make sure nothing interferes, but this bug seems to be reproducible everywhere. |
Sorry @karolyi, I can't reproduce this. You'll need to do some more legwork to identify why the toolbar isn't integrating well with your project. From there we can decide if it's something with the toolbar that needs to change or the integration itself. |
I figured. Can you please at least give me a hint about where to find how the toolbar recognizes if a request is a history panel request or not, so it wouldn't fire another request for getting the info of it? |
|
Thanks. Will look into it and touch base later. I need some time which I'm really in short supply of, nowadays. |
So, I've found the culprit. Originally, I used to add the debug URLs to urlpatterns with: if settings.DEBUG:
# Add debug toolbar
from debug_toolbar import urls as debug_urls
urlpatterns += [re_path(route=r'^__debug__/', view=include(
debug_urls, namespace='debug_toolbar'))] This must have been the old way of adding debug toolbar urls, and must have changed somewhere along the way. Since the function you mentioned checks for Upon updating to the 'new' method of adding debug toolbar URLs, normality has been restored. |
I'm glad you figured out the issue. Thank you for following up with the solution! If others run into this, please comment. For now we're not going to make a change (I think). |
I am still seeing the same issue unfortunately, even when using the Possibly interesting factors are that I use the debug toolbar for a JSON API, so I never open it on the actual page I'm inspecting. Rather, I open it on a Django admin panel view, and use the History panel exclusively. Also, I use Django's Basically, after opening the History panel and refreshing it once, it keeps sending requests infinitely as described in the original issue. The only workaround I've found is to set something like: |
What are the full relative paths for the toolbar view requests? |
It seems like |
@dmartin, I figured out the error by putting debugging information into DebugToolbar.is_toolbar_request. That way, you would have an idea as to why it isn't recognized as a debug toolbar view. |
Yeah, I think I was able to narrow it down to 68039c6. That change was made based on the idea that the toolbar never introspects its own requests, but that has not been the case for me, even on 4.3 before this issue began, e.g: ![]() I wonder if it has to do with the odd |
Oops, put some print statements in Edit: Aha, if I patch from django.urls import get_script_prefix
resolver_match = request.resolver_match or resolve(
request.path.replace(get_script_prefix(), "/"), getattr(request, "urlconf", None)
) then everything works as expected. This is similar to https://code.djangoproject.com/ticket/31724. Would a PR like the above be accepted to make the toolbar work with |
Hey,
not sure what I'm mistaking here, but as I open the history panel (without using daphne so it can be turned on), I get endless requests upon trying to open thw history panel:
It is about 3 requests/sec and I have no idea if that is alright or where to configure it to emit less requests. Normally I would prefer that it only gets the request history when I open the panel, but I couldn't find such an option. It is super hard to find information for the request I really need because what I see is this:
Any help here?
The text was updated successfully, but these errors were encountered: