Middleware that Prints the number of DB queries to the runserver console
Inspired by this post by David Szotten, this project gives you a middleware that prints DB query counts in Django’s runserver console output.
Installation
pip install django-querycount
Just add querycount.middleware.QueryCountMiddleware
to your MIDDLEWARE
.
Notice that django-querycount is hard coded to work only in DEBUG mode set to true
Settings
There are two possible settings for this app: The first defines threshold values used to color output, while the second allows you customize requests that will be ignored by the middleware. The default settings are:
QUERYCOUNT = {
'THRESHOLDS': {
'MEDIUM': 50,
'HIGH':