Debugger - adeemacdowell/adeemacdowell.github.io GitHub Wiki

python debugger PDB

import pdb; pdb.set_trace()


pip install ipdb

import ipdb; ipdb.set_trace()

https://www.journaldev.com/22695/python-breakpoint

https://www.digitalocean.com/community/tutorials/how-to-use-the-python-debugger

https://www.youtube.com/watch?v=RXRdu-0XBDc&t=338s


Debug pytest in Pycharm

Settings > Tools > Python Integrated Tools > Testing > Default test runner > pytest

Settings > Languages > Django > Do Not use django test runner > TRUE

Settings > Languages > Django > Settings > config/settings/local.py


Debug expression

alt F8 then add expression list(nameofqueryset)

Pycharm

install ipython

view breakpoints

mute breakpoints

using frames as traceback

run to cursor

ctrl shift a - actions

add type hints for function (settings-build-python debug-collect runtime types) [need to run out in debug first] **slow the debugger-turn it off

stepping - exclude django and python files

logging - set point-rightclick-unsuspend-log-f-string

break on condition - eg break if id=1

actions - view breakpoints

create parameter

ctrl Q = documentation

ctrl P = show parameters