from django.db import connection from django.template import Template, Context class SQLLogMiddleware: def process_response ( self, request, response ): time = 0.0 for q in connection.queries: time += float(q['time']) t = Template('''
Total query count: {{ count }}
Total execution time: {{ time }}