I have a large complex Django App that we use that does lots of things. From looking at the Django Debug Toolbar some of our views do a lot of SQL requests. I want to increase the performance of it by reducing the number of SQL requests (e.g. by adding more select_related
, more clever queries, etc.). I would like to be able to measure the improvement as I go along, to encourage me and to be able to say how much fat has been trimmed. I have a large set of django unit tests for this app that touch on lots of parts of the code.
Is there some library/programme/script can run the unittests and then print out how many SQL requests in total were executed? This way I can iterativly improve our app.