Python html file server using streamlit?

The trouble is that the files in your repository aren’t automatically served up and made available to the web host. For example, when you use st.image and feed it a relative path to an image, then Python can get to it as a file saved in the back end. Streamlit will copy that image file and make it available to the web host at ./media/<some hash>.jpg. (I am not clear if this is an actual copying over to another web host file architecture or just some routing that creates the local web paths virtually.)

So, you will either need to host the image files elsewhere or manually serve them up so they can be accessed via web. I was just playing with this recently, and @asehmi has a lovely example. Hybrid architecture media server, media service and Streamlit client app using FastAPI and Python

1 Like