Vs code debug

Hi,

It’s good practice to use a remote debugger for server apps. I’ve built a little wrapper for debugpy (pip install debugpy) which you can use. The code is available in my gist here. Full instructions included on creating the launch.json file and adding two lines of code to your top level Streamlit app.

Benefits: (a) You can use this approach to debug locally and into apps running in local or remote dockers. (b) You can launch the debugger anytime after your Streamlit app has started, and (c) You can control the wait_for_client flag to pause and wait (=True) for you to start the debugger. The debugger wrapper is enabled by making flag=True.

I never build any apps without this.

HTH,
Arvindra

1 Like