How to disable automatic variable evaluation when debugging?


PyCharm's debugger automatically evaluates variables when debugging which is very handy 99.99% of the time. However, this is having a side effect that is really hurting what I am trying to do: log SQL queries generated by each line of code. Since PyCharm is evaluating existing QuerySets and other db related variables, it is querying the database and these hits are getting logged too. You see the problem.

Is there any way to disable that automatic evaluation?


File | Settings | Build, Execution, Deployment | Debugger | Data Views > disable Enable auto expressions in Variables view


I changed the setting but it's still calling the `__str__` method. What should I expect to see?


Please sign in to leave a comment.