-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathstreamlit.html.markerb
More file actions
59 lines (38 loc) · 1.57 KB
/
streamlit.html.markerb
File metadata and controls
59 lines (38 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
title: Run a Streamlit app
layout: framework_docs
objective: Streamlit turns data scripts into shareable web apps in minutes. All in pure Python. No front‑end experience required.
redirect_from:
- /docs/languages-and-frameworks/streamlit/
- /docs/getting-started/streamlit/
order: 3
---
<%= partial "/docs/languages-and-frameworks/partials/intro", locals: { runtime: "Streamlit", link: "https://streamlit.io/" } %>
Streamlit turns data scripts into shareable web apps in minutes. All in pure Python. No front‑end experience required.
Spinning up a `streamlit` app takes no time at all!
## _Speedrun_
<%= partial "/docs/languages-and-frameworks/partials/flyctl" %>
<%= partial "/docs/python/partials/speedrun", locals: { runtime: "streamlit", repo: "hello-streamlit" } %>
## _Deploy a Streamlit from scratch_
<%= partial "/docs/python/partials/uv_init", locals: { runtime: "Streamlit" } %>
Then we have to add the streamlit dependency:
```cmd
uv add streamlit
```
Now, let's create a simple streamlit app in `main.py`:
```python
import streamlit as st
st.write('hello from fly.io')
```
We can then serve the development version of the app using the `streamlit` cli tool:
```cmd
streamlit run main.py
```
This will display a 'hello from fly.io!' message when you visit the root URL.
Before deploying, we must add a bit of configuration to `.streamlit/config.toml`:
```toml
[server]
headless = true
```
This ensures that our app doesn't give a prompt when we ship it.
<%= partial "/docs/python/partials/deploy", locals: { runtime: "streamlit", repo: "hello-streamlit" } %>