5

I'm using Flask 0.9 with Python 2.7.1 within a virtualenv, and starting my app with foreman start

In other apps I've built when I add the following line to my app:

import pdb; pdb.set_trace()

then reload the browser window, my terminal window displays the pdb interactive debugger:

(pdb)

However in my app when I add those lines nothing happens. The browser window hangs and shows a constant state of loading yet nothing shows in the console.

Is there some magic that needs to happen?

1 Answer 1

9

This is because you're using Foreman, which captures the standard output.

To debug your app with pdb, you'll need to "manually" run it, using python app.py or whatever you use.

Alternatively, you can use WinPDB (which, despite the name, has nothing to do with the operating system), which will let you remotely debug a Python process. You can even use it when the program is running on another server.

Sign up to request clarification or add additional context in comments.

1 Comment

Ahhh. I had no clue. Thanks for that tidbit David.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.