Codespaces and st.secrets

Hi there,

Can I check if we were to use Codespaces, could we store secrets.toml in Codespaces or we need to use the Codespaces secrets storage for the environment variables?

I am running a workshop on Streamlit and Generative AI and I am trying to get my participants to use Codespaces so I may need to tweak the code if we need to use the Codespaces secrets storage way. Thanks in advance


It is not advisable to store secrets in GitHub. You can add the secrets to the app after it has been deployed. If you’re testing the app while in codespaces, you can use the secrets.toml file but make sure to add the path (.streamlit/secrets.toml) to .gitignore so when you commit the changes to the repo it does not get saved in GitHub.
I hope this helps.

Thank you. So I can use the .streamlit/secrets.toml in codespace

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.