Deploying to Streamlit Cloud
A project that is not deployed does not count. Recruiters cannot click "I built this on my laptop". Today we make it clickable.
You wrote a song. Now it is time to upload it to Spotify. Same song. Suddenly real.
Streamlit Cloud is free, GitHub-integrated, and deploys in 3 clicks. Steps:
- Push your app to a public GitHub repo.
- Add a
requirements.txt. - Sign in at
share.streamlit.iowith GitHub. - Click "Deploy", choose repo, branch, and file.
- Add your API key as a secret in the Streamlit settings (not in code).
You get a public URL like your-app.streamlit.app.
requirements.txt:
streamlit
openai
python-dotenv
In Streamlit Cloud settings, add:
OPENAI_API_KEY = "sk-..."
Load it in your code via st.secrets or os.environ (Streamlit injects secrets as env vars). Make sure your code never tries to read .env in production.
Quick recall
3 prompts · think before you flip
Prompt 1 of 3
What goes in `requirements.txt`?
Quiz time
1 question · tap an answer to check it
1. The right place to put your API key for a Streamlit Cloud deploy is
Finished lesson 6.6?
Mark complete to update your module progress and unlock the streak.