Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Django debug toolbar to profile POST responses

Django debug toolbar is a great tool to profile slow SQL queries - among other things. I'm able to do this for GET responses in my Django app. My question is: how do I profile (and optimize) my POST responses?

like image 937
Hassan Baig Avatar asked Jul 11 '16 14:07

Hassan Baig


1 Answers

Django-Debug-Toolbar works the same with GET and POST requests.

However, one common UI design pattern is that successful form submissions lead to a redirect, which loads a new view and makes you lose all the SQL history in DDT.

If this is the case, one of the panels on DDT allows you to intercept redirects and inspect SQL queries at each step.

Also, if your problem comes from making AJAX calls, you should have a look at the answers to this question: How to use django-debug-toolbar on AJAX calls?

like image 111
raphv Avatar answered Sep 21 '22 10:09

raphv