This is not a clean solution, but if you just want to debug without installing additional packages, you can look for the execute () method in django / db.
For Oracle , I think it is in:
django / db / backends / oracle / base.py and find:
def execute
For PostgreSQL, it is located in:
Django / db / backends / postgresql_psycopg2 / base.py
There is an execute () method in CursorWrapper.
Both catch IntegrityError and DatabaseError, you can add a print statement there. A.
For ppl who want to see all SQL queries, put a print statement right after the function call.
source share