# Streamlit Tutorials: A Guide from First App to Deployment

> A guide to Streamlit in Python covering the first app, charts, st.cache_data and st.cache_resource, st.session_state, a KPI dashboard and deployment, with the order to read each tutorial in.

Source: https://www.pythoncharts.com/streamlit/streamlit-python-guide/ | Published: 2026-11-26 | Author: Alex Scott | Category: Streamlit | Tags: streamlit, dashboard, caching, st.session_state, deployment, guide

Streamlit turns a Python script into a web app: call functions like `st.title`, `st.slider` and `st.line_chart`, then start it with `streamlit run app.py`. These tutorials go from that first script to a deployed dashboard. Each one has code you can copy and screenshots of the result, written for Streamlit 1.67.

![Grid of six Streamlit app screenshots: a running log, four chart libraries compared, a temperature chart, a push-up tracker, a KPI dashboard and a savings calculator](https://www.pythoncharts.com/streamlit/streamlit-python-guide/images/streamlit-hub-montage.png)

## Which Order Should I Learn Streamlit In?

| Step | Question | Tutorial |
|---|---|---|
| 1. Start | How do I make an app with widgets and charts? | [Build Your First Streamlit App](https://www.pythoncharts.com/streamlit/first-streamlit-app/) |
| 2. Chart | `st.line_chart`, Matplotlib, Plotly or Altair? | [Charts in Streamlit](https://www.pythoncharts.com/streamlit/streamlit-charts-compared/) |
| 3. Speed up | Why does my data reload on every click? | [Streamlit Caching](https://www.pythoncharts.com/streamlit/streamlit-caching/) |
| 4. Remember | Why does my counter keep resetting? | [Streamlit Session State](https://www.pythoncharts.com/streamlit/streamlit-session-state/) |
| 5. Assemble | How do I build a dashboard with KPI cards and filters? | [KPI Dashboard](https://www.pythoncharts.com/streamlit/streamlit-kpi-dashboard/) |
| 6. Share | How do I put the app online? | [Deploy a Streamlit App](https://www.pythoncharts.com/streamlit/deploy-streamlit-app/) |

## Streamlit Layouts, Uploads, and Multipage Apps

Once the basics work, pick the tutorial for what your app needs next:

| You want to | Tutorial |
|---|---|
| Arrange a sidebar, columns and tabs | [Streamlit Layout](https://www.pythoncharts.com/streamlit/streamlit-layout/) |
| Let people upload their own CSV | [Streamlit File Uploader](https://www.pythoncharts.com/streamlit/streamlit-file-uploader/) |
| Split the app into pages | [Multipage Apps](https://www.pythoncharts.com/streamlit/streamlit-multipage-app/) |
| Build a chat interface for an LLM | [Streamlit Chatbot](https://www.pythoncharts.com/streamlit/streamlit-chatbot/) |
| Size and analyze experiments | [A/B Test Calculator](https://www.pythoncharts.com/streamlit/streamlit-ab-test-calculator/) |

If you haven't settled on Streamlit yet, [Streamlit vs Dash vs Shiny vs Gradio vs Panel](https://www.pythoncharts.com/python/streamlit-vs-dash-vs-shiny-vs-gradio-vs-panel/) builds the same app in all five.

## How a Streamlit App Runs

Streamlit runs your script from top to bottom, and runs the whole script again whenever someone changes a widget. A widget call such as `goal = st.slider(...)` returns the current value, so simple apps need no callbacks.

That rerun model is the reason for the two features people meet next:

| Tool | Scope | Use it for |
|---|---|---|
| Local variable | One run of the script | Anything cheap to recompute |
| `st.session_state` | One browser tab's session | Counters, user choices, multi-step forms |
| `st.cache_data` | All users, by default | DataFrames, query results, API responses |
| `st.cache_resource` | All users, by default | Database connections, ML models, API clients |
| `st.query_params` | Whoever has the URL | Shareable filters and views |

`st.cache_data` returns a fresh copy on every call, while `st.cache_resource` returns the same object, so changes to it affect everyone.

## Which Chart Function Should I Use?

| Call | Best for |
|---|---|
| `st.line_chart`, `st.bar_chart`, `st.area_chart`, `st.scatter_chart` | Quick charts straight from a DataFrame |
| `st.pyplot` | Static Matplotlib or Seaborn figures |
| `st.plotly_chart` | Hover, zoom, selection events and many chart types |
| `st.altair_chart` | Declarative charts with linked selections |

Start with the built-in call and switch when you need something it can't express. The [chart comparison](https://www.pythoncharts.com/streamlit/streamlit-charts-compared/) draws the same data all four ways. For a number with a change arrow and a sparkline, use `st.metric`, shown in the [KPI dashboard](https://www.pythoncharts.com/streamlit/streamlit-kpi-dashboard/).

## Common Streamlit Problems

| Problem | Fix | Details |
|---|---|---|
| `python app.py` shows no app | Run `streamlit run app.py` | [First app](https://www.pythoncharts.com/streamlit/first-streamlit-app/) |
| `st.button` goes back to `False` | It is `True` for one run only; store the result in `st.session_state` | [Session state](https://www.pythoncharts.com/streamlit/streamlit-session-state/) |
| Page shows the old value after a click | Update it in an `on_click` callback | [Session state](https://www.pythoncharts.com/streamlit/streamlit-session-state/) |
| A cached list keeps growing | Use `st.cache_data` instead of `st.cache_resource` | [Caching](https://www.pythoncharts.com/streamlit/streamlit-caching/) |
| `ModuleNotFoundError` after deploying | Add the package to your dependency file | [Deployment](https://www.pythoncharts.com/streamlit/deploy-streamlit-app/) |

## Where Can I Host a Streamlit App?

[Streamlit Community Cloud](https://share.streamlit.io) is the quickest free option and deploys from a GitHub repository, but apps sleep when idle. Render suits small production apps that need a custom setup, and Docker works when the app has to run on your own infrastructure. The [deployment tutorial](https://www.pythoncharts.com/streamlit/deploy-streamlit-app/) covers all three and their limits.

## Similar Topics

- [Python Interactive Charting Libraries Compared](https://www.pythoncharts.com/python/python-interactive-charting-libraries-compared/)
- [Let an LLM Generate Charts from a DataFrame](https://www.pythoncharts.com/ai/llm-generate-charts-from-dataframe/)
