Debugging techniques
Mastering debugging application development is crucial for identifying and fixing issues efficiently. This recipe delves into the practical use of the debugger, leveraging tools and strategies to pinpoint problems in your FastAPI code.
Getting ready
All you need to do to apply the recipe is to have a running application. We can keep on working with our protoapp
.
How to do it...
The Python distribution already comes with a default debugger called pdb
. If you use an integrated development environment (IDE), it usually comes with an editor distribution debugger. Whatever you are using to debug your code, you must be familiar with the concept of breakpoints.
A breakpoint is a point within the code that pauses the execution and shows you the state of the code variables and calls. It can be attached with a condition that, if satisfied, activate it or skips otherwise.
Whether you are using the Python distribution debugger pdb
or the one provided by your...