Created
September 28, 2016 09:25
-
-
Save savanovich/763d92f960988487e440be27bfd6c003 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
import sqlparse | |
from django.conf import settings | |
from django.db import connection, reset_queries | |
settings.DEBUG = True | |
reset_queries() | |
# do orm queries... | |
for q in connection.queries: | |
print(sqlparse.format(q['sql'], reindent=True, keyword_case='upper')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment