Categories
Python Answers

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

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *