Instructions for debugging Python code in production mode

Would it be possible to collect basic instructions for self debugging the Python code whenever errors pop up?

This relates to my previous post about debugging ADS1115 issues. I’d love to step into the Python code using pdb(python debugger) so I can diagnose the issues myself.

I’m wondering what the steps might be to launch the server in production mode or development mode(with the prod devices attached), and run from within flask so as to step through pdb.set_trace().

I’ve tried flask run with the in debug mode, but can’t get 127…:5000 to load the frontend.

Any general debugging tips that can be offered?