Created
January 18, 2021 02:25
-
-
Save kyanny/28bb523ea4e39afcf51c8b3ce33088d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import connections,connection,reset_queries | |
from django.conf import settings | |
settings.DEBUG = True | |
def query_count(reset=True): | |
total = sum(len(c.queries) for c in connections.all()) | |
if reset: | |
reset_queries() | |
return total | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment