Recognized Filename | +Python Package Manager | +
---|---|
Pipfile |
+ pipenv | +
environment.yml |
+ conda | +
requirements.txt |
+ pip | +
pyproject.toml |
+ poetry | +
mysqlclient
is a Python package which requires additional software be installed to function. A valid `packages.txt` file to enable `mysqlclient` would be:
+
+```bash
+ build-essential
+ pkg-config
+ default-libmysqlclient-dev
+```
diff --git a/data/deploy/community-cloud/deploy-your-app/secrets-management.md b/data/deploy/community-cloud/deploy-your-app/secrets-management.md
new file mode 100644
index 0000000000000000000000000000000000000000..c6e6398a1c22fbcec7e21dc09797161b626694d7
--- /dev/null
+++ b/data/deploy/community-cloud/deploy-your-app/secrets-management.md
@@ -0,0 +1,117 @@
+---
+title: Secrets management
+slug: /deploy/streamlit-community-cloud/deploy-your-app/secrets-management
+---
+
+# Secrets management
+
+## Introduction
+
+If you are [connecting to data sources](/develop/tutorials/databases), you will likely need to handle credentials or secrets. It's generally considered bad practice to store unencrypted secrets in a git repository. If your application needs access to sensitive credentials the recommended solution is to store those credentials in a file that is not committed to the repository and to pass them as environment variables.
+
+Secrets management allows you to store secrets securely and access them in your Streamlit app as environment variables.
+
+## How to use Secrets Management
+
+### Deploy an app and set up secrets
+
+1. From your worksapce at share.streamlit.io, click "**New app**".
+2. Fill out your app's information and click "**Advanced settings...**"
+
+ 
+
+3. A modal will appear with an input box for your secrets.
+
+ 
+
+4. Provide your secrets in the "Secrets" field using TOML format. For example:
+
+ ```toml
+ # Everything in this section will be available as an environment variable
+ db_username = "Jane"
+ db_password = "12345qwerty"
+
+ # You can also add other sections if you like.
+ # The contents of sections as shown below will not become environment
+ # variables, but they'll be easily accessible from within Streamlit anyway
+ # as we show later in this doc.
+ [my_cool_secrets]
+ things_i_like = ["Streamlit", "Python"]
+ ```
+
+### Use secrets in your app
+
+Access your secrets as environment variables or by querying the `st.secrets` dict. For example, if you enter the secrets from the section above, the code below shows you how you can access them within your Streamlit app.
+
+```python
+import streamlit as st
+import os
+
+# Everything is accessible via the st.secrets dict:
+st.write("DB username:", st.secrets["db_username"])
+st.write("DB password:", st.secrets["db_password"])
+st.write("My cool secrets:", st.secrets["my_cool_secrets"]["things_i_like"])
+
+# And the root-level secrets are also accessible as environment variables:
+st.write(
+ "Has environment variables been set:",
+ os.environ["db_username"] == st.secrets["db_username"],
+)
+```
+
+Foo bar.
" +) +``` + +