I'm a big fan of Django Debug Toolbar and wanted to debug my Tastypie based api using just that, after some googling I found the following implementation. It's exactly what I needed, where api result are wrapped in html and therefore triggers the toolbar through middleware. Problem is that the solution is hardcoded. So I took a more flexible approach. Got any suggestions? Fork it.