Turns out, flask's debug error page provides a python shell. Turning off debug mode.