Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django debug toolbar not showing up for certain views

debug toolbar doesn't show up for views which return HttpResponse() rather than render_to_response().

a view with return HttpResponse()(for test sake) won't show up debug toolbar..

like image 680
eugene Avatar asked Dec 04 '22 13:12

eugene


1 Answers

The problem is not that you are using HttpResponse, but the content you return when you do so.

From the readme on django debug toolbar‘s github page:

Note: The debug toolbar will only display itself if the mimetype of the response is either text/html or application/xhtml+xml and contains a closing </body> tag.

like image 77
Alasdair Avatar answered Feb 04 '23 17:02

Alasdair