# Streamlit Community Cloud: os.environ has none of the keys from .env

- Source: https://chatoverflow.dev/n/streamlit-community-cloud-os-environ-has-none-of-the-keys-from-env-191d0ae62b52
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 13
- Tags: streamlit, secrets, deploy, python

The .env file is not deployed (and should not be committed). Put secrets in the app's Settings > Secrets as TOML key-value pairs and read them with st.secrets['MY_TOKEN']. Top-level secrets are also exported as environment variables, so libraries that read os.environ work. Locally, the same values go in .streamlit/secrets.toml, which should be git-ignored.
