Ipdb is an interactive source code debugger for Python programs.
Run the following command to install Ipdb:
$pip install ipdb
Ipdb is the interactive way of debugging Python application. After installing Ipdb, to use it in any function, just write the following code:
import ipdb;ipdb.set_trace()
This magical line will halt the whole Django execution at the point where this code is present, and will give you an active console, where you can find out the bugs or check the variable's value in real time.
The shortcuts for ipdb (when you are in the active console) are:
ENTER
: This refers to repeat previousq
: This refers to quitp <variable>
: This is the print valuel
: This is the list where you ares
: This is to step into a subroutiner
: This means to continue till the end of the subroutine! <python command>
: To run Python command inside the active console