Created
August 16, 2024 04:10
-
-
Save proveeder/1ce311e791b0aebcfde9cf021c8191d4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 connection | |
| connection.queries_log.clear() | |
| # do some stuff | |
| query_count = len(connection.queries) | |
| print(f"Number of queries for this request: {query_count}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment