```toml
.streamlit/secrets.toml
[postgres]
host = "localhost"
port = 5432
dbname = "xxx"
user = "xxx"
password = "xxx"
```
Add this file to .gitignore and don't commit it to your Github repo!
Copy your app secrets to the cloud
As the secrets.toml file above is not committed to Github, you need to pass its content to your deployed app (on Streamlit Cloud) separately. Go to the app dashboard and in the app's dropdown menu, click on Edit Secrets. Copy the content of secrets.toml into the text area. More information is available at Secrets Management.
Add psycopg2 to your requirements file
Add the psycopg2 package to your requirements.txt file, preferably pinning its version (replace x.x.x with the version you want installed):
```bash
requirements.txt
psycopg2-binary==x.x.x
```
Write your Streamlit app
