diff options
author | Frederick Muriuki Muriithi | 2023-05-22 08:46:05 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-05-22 08:47:27 +0300 |
commit | f65abc2cd4cff4ddf42222fa3e1fea9254cc4722 (patch) | |
tree | 9a0a9d93cf5bc7864a4456c6b7eb8158b2241dff | |
parent | 29eef2ab22d2976657f6a69a5514ba7d1f7d0b35 (diff) | |
download | gn-gemtext-f65abc2cd4cff4ddf42222fa3e1fea9254cc4722.tar.gz |
Add documentation on running flask under pdb
-rw-r--r-- | topics/using-pdb-to-troubleshoot.gmi | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/topics/using-pdb-to-troubleshoot.gmi b/topics/using-pdb-to-troubleshoot.gmi index 06ac37a..4cfe616 100644 --- a/topics/using-pdb-to-troubleshoot.gmi +++ b/topics/using-pdb-to-troubleshoot.gmi @@ -1,6 +1,6 @@ # Using PDB to Troubleshoot Python Code -# Tags +## Tags * type: documentation * keywords: debugging, python @@ -97,8 +97,27 @@ With regards to testing, pdb is also integrated with test-runners. To use pdb wi | pytest --pdb `---- +## Running Flask Applications Under pdb -### Useful Tutorials +To troubleshoot a Flask application (and any other application running via an +applicationsserver of sorts), you might need to start the application server under +the debugger, otherwise, you will get an error like: + +``` +BdbQuit +``` + +Ideally, you shouldn't need to, as the terminal where you started the +application server (Flask) should drop you into the debugger automatically. + +If you run the application under other application servers like gunicorn, then +you might need to increase the timeout period to prevent gunicorn from killing +the process, leading to the error above. Generally speaking, you **SHOULD NOT** +be running the debugger in production anyway, and therefore you should not need +to deal with the gunicorn issues. + + +## Useful Tutorials To learn more about pdb, you can check out: |