如何在AJAX调用上使用django-debug-toolbar? [英] How to use django-debug-toolbar on AJAX calls?

查看:127
本文介绍了如何在AJAX调用上使用django-debug-toolbar?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有合理的方式使用(惊人的)django-debug工具栏和AJAX查询,我很好奇。



例如,我使用一个jQuery $ .get与一堆参数来打Django URL,并将其加载。如果我有错误,它没有在工具栏上注册。我也不能通过复制AJAX URL来使用它,因为DDT附加到响应的body标签,使用AJAX响应来包含body标签是没有意义的。



任何方向都会有帮助!谢谢!

解决方案

我以前也有同样的问题!
随着我越来越多的AJAX重应用程序,我发布了一个 Django应用程序和一个 Chrome扩展程序,一起解决了这个问题。



所有信息都在github资料库中。


I'm curious if there's a reasonable way to use the (amazing) django-debug-toolbar with AJAX queries.

For example, I use a jQuery $.get with a bunch of parameters to hit a Django URL and load it inline. If I have an error with that, it isn't registered on the toolbar. I also can't use it by copying the AJAX URL because DDT attaches to the body tag of the response, and it wouldn't make any sense to be including body tags with AJAX responses.

Any direction would be helpful! Thanks!

解决方案

I had the same problem before! And as I'm doing more and more AJAX heavy applications, I released a Django Application and a Chrome extension that together solved exactly that problem.

All the information is in the github repository.

这篇关于如何在AJAX调用上使用django-debug-toolbar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆