Search code examples
debuggingpython-2.7tornado

Set break points in Tornado app


How could I set a break point in my tornado app?
I tried pdb, but Tornado app seams to be ignoring my pdb.set_trace() command in my app.


Solution

  • If you are running your app using foreman you would set you environment variable in .env file in root project folder. Setting the below env variable in my .env file did the tick form me.

    PYTHONUNBUFFERED=true

    Now I can set code breakpoints in my app, and also print output to server logs while running the app using foreman.