Menu Close

How to see the raw SQL queries Python Django is running?

To see the raw SQL queries Python Django is running, we print the connection.queries value.

For instance, we add

from django.db import connection
print(connection.queries)

in our app to print the SQL queries being run.

Posted in Python, Python Answers