Deploy Streamlit App to Cloudflare Pages

Is it possible to deploy a streamlit app to cloudflare pages? Streamlit is basically a python web app framework. Read more here: https://streamlit.io/ I've tried deploying it to cloudflare pages and it manages to build but hangs at this step and doesnt get to the deploying step. It hangs right after it says its ready to view in the browser and has a URL available. The build command is as follows: python -m streamlit run your_script.py
Streamlit • A faster way to build and share data apps
Streamlit is an open-source app framework for Machine Learning and Data Science teams. Create beautiful web apps in minutes.
2 Replies
Chaika
Chaika16mo ago
It looks like streamlit runs its own python web server, which won't work with Pages ?pages-webserver
Flare
Flare16mo ago
Cloudflare Pages is for static content (HTML, CSS, JS, images and other such files). It will not run a webserver such as Express, Koa or the likes. If you're using those to serve static content then you can just remove that part and use Pages! If you're doing more dynamic content you can use Functions (https://developers.cloudflare.com/pages/platform/functions). It will run code on request (so still not a webserver in the conventional sense). This would allow for more dynamic content though especially with KV (Key Value storage) and Durable Objects (transactional data storage). Functions are natively integrated with Pages so are super easy to get up and running along your website. Otherwise, a good old VPS or dedicated server from one of the many hosts out there is for you.
Want results from more Discord servers?
Add your server