Summary
This brings us to the end of discussing the use of debuggers when developing Django application code. In this chapter, we:
Implemented the display of survey results using
pygooglechart
to create pie charts. When we ran into some trouble along the way, we saw how the Python debugger, pdb, could be used to help figure out what was going wrong. We experimented with many of the most useful pdb commands. We learned the commands used to see the context of the code that is running, examine and change the values of variables, and flexibly control the execution of the code as it proceeds in the debugger.Re-implemented the display of survey results using the
matplotlib
library. For this alternative implementation, we ended up needing to write code that was vulnerable to multi-process race conditions. Here we saw how pdb can be used to help verify correct behavior of this type of code, since it allows us to force problematic race conditions to occur, and then verify that the code behaves properly...