I’ve a fully functional streamlit app when I’m running locally, but when I run it on streamlit-cloud it fails at the last hurdle.
I need to serve a folder of content as a website (before final deploy). I build the content with mkdocs and then run a subprocess for to serve the content (there may be a better way):
p = subprocess.Popen("python -m http.server -d site 9001".split())
st.session_state["server_pid"] = p.pid
components.iframe("http://localhost:9001/", height=1200)
What I see on streamlit-cloud is “localhost refused to connect”, which is understandable.
Does anyone have a solution for this? Is there a native way to embed the pre-generated website?
In general we wanted to be careful about exposing more ways to serve arbitrary html/js/css in Streamlit, so it won’t work for this use case (html files will render as plaintext). But depending on the feedback on the feature we will consider whether to expose it in the future.
Curious to know if this config/folder based approach makes sense for your use case or if it would need a component API like the one you proposed.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.