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

SQL queries are shown escaped and query details are no longer accessible with version 1.4 #775

Closed
arnaudblois opened this issue Nov 17, 2015 · 7 comments
Labels

Comments

@arnaudblois
Copy link

With Django 1.8.6 and the default sqlite database, in the SQL section the queries are displayed escaped into their HTML code, which makes them very hard to read. Also, when clicking on the little expand toggle button, it does not give the line of code which generated the query as it used to. Interestingly, AJAX requests seen using the chromium extension are displayed as they should.
This seems to be a regression as everything works fine with version 1.3.2.
Thanks !

@aaugustin aaugustin added the Bug label Nov 20, 2015
@dilrajsachdev
Copy link

I am using Django 1.9 and django-debug-toolbar 1.4, I am getting this error too. I just had a quick look and it looks like it is with sql.utils.BoldKeywordFilter, if I disable this then I can read sql.
Just wan to share this, if this helps
Thanks

@prashker
Copy link

prashker commented Jan 4, 2016

@dilrajsachdev How did you disable BoldKeywordFilter?

edit: Okay so its in debug_toolbar/panels/sql/utils.py....I'd rather not touch the library though so hopefully this can actually be fixed

@kvikshaug
Copy link

I experienced this behavior when using Debug Toolbar together with Django Debug Panel 0.8.2 for debugging AJAX requests.

Removing DebugPanelMiddleware from middlewares and reverting back to the original DebugToolbarMiddleware seems to resolve the issue in my case. Naturally, Debug Panel won't be usable until the issue is fixed.

If this is the case with you as well, maybe the issue lies with Debug Panel's overrides and not here with Debug Toolbar. Although, adjustments for DT 1.4 has been made so I can't confirm the cause for this.

HTH

@prashker
Copy link

prashker commented Jan 6, 2016

I've basically confirmed that its been narrowed down to BoldKeywordFilter as previously determined. However I don't have enough time to actually try to fix this.

@muratcorlu
Copy link

I confirm that bug with Django 1.8.4. Using DebugToolbarMiddleware instead of DebugPanelMiddleware fixed the problem.

@thebitguru
Copy link

@muratcorlu, thanks! Changing the middleware fixed it for me as well.

@aaugustin
Copy link
Contributor

I gather from the discussion that the bug only appears when Django Debug Panel is in use, and that's a third party project.

faulkner added a commit to faulkner/django-debug-panel that referenced this issue Apr 18, 2016
This should resolve jazzband/django-debug-toolbar#775.
There's probably a cleaner solution.  This just avoids calling
generate_stats() multiple times for the SQL panel since it looks like
the code escapes the raw SQL data in place.

Only tested this against django-debug-toolbar 1.4 with django
1.8.11 - may require tweaks to run against different versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants