django-planet
Dec. 5, 2024

Django: launch pdb when a given SQL query runs

published by Adam Johnson
in blog Adam Johnson
original entry Django: launch pdb when a given SQL query runs

Here’s another technique for using pdb within Django. I will add this to the new debugging chapter of Boost Your Django DX in a future update.

When debugging Django code, you might need to start with a given SQL query and work backwards to find the code that triggered …