Using `pdb` is best to debug in real-time your python/django project.
To run pdb on a python file,
python -m pdb <python file>To run pdb on django project,
python -m pdb manage.py runserverthis will initialize pdb on your django project.
Place this one line of python code to put pdb to work in that line of your code:
pdb.set_trace()when you start interacting with your django project, either GET/POST requests,
pdb will start to work when the execution reaches the part of your code where you put
the pdb.set_trace(). you can execute one line of python code to check for values of the variables.
If you want to execute multiple lines of python code while in pdb mode, type this code:
This will make you go to interactive python debugger.
and then when you think you are done and you want to go back to pdb mode,
Ctrl + Dand you will be back to pdb mode.