Skip to content

Instantly share code, notes, and snippets.

@rafaelhenrique
Last active March 25, 2020 19:54
Show Gist options
  • Save rafaelhenrique/764e43ce2ef0aea1cd7206e04debc443 to your computer and use it in GitHub Desktop.
Save rafaelhenrique/764e43ce2ef0aea1cd7206e04debc443 to your computer and use it in GitHub Desktop.
Measure time of query in Django
from django.db import connection
# [... code of query here ...]
print(queryset) # querysets needs be used, because this is lazy
print(connection.queries)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment