Debugging Streamlit with PyCharm

Photo by path digital on Unsplash

Streamlit is a Python package that allows you to build beautiful dashboards from Python without the need for a deep knowledge of front-end development. This is my case. I have never been interested that much in front-end development. I was, and I am a backend developer type.
Since I am playing with different data coming from our systems, I found Streamlit incredibly useful for organizing and visualizing the data I collect. You can run your dashboard locally and deploy it in the cloud when you need to share it with others in your organization.
I love PyCharm, which I use for my Python development.
As for every application, you need some debugging to ensure you are doing the right thing.
When you develop locally, you run a local Streamlit, dedicated web server. How can you debug my script in PyCharm?
I spent some time thinking about it and found a solution that may be helpful to other people out there. This will work in Visual Studio Code as well, but I didn’t try it since I don’t love Visual Studio Code so much.
You can add a Run/Debug configuration to PyCharm like the one you see below:

PyCharm – Add Run/Debug Configuration

Now you can set your breakpoints in the script and debug it as you usually do in PyCharm.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Commenti
Newest
Oldest Most Voted
Inline Feedbacks
View all comments