Hi Everyone,
For the first time, i am trying to connect postgres DB using st.secrets[“postgres”] and end up with invalid directory. Not sure why its saying file not found even though file exists in the look up directory
here is my secrets file structure in vscode on windows
C:\Users\E57036\Desktop\Python_Work\Streamlit_Dashboard.streamlit\secrets.toml
[
postgres
]
host=""
port=
dbname=""
username=""
password=""
here is the code.
import streamlit as st
import psycopg2
def init_connection():
return psycopg2.connect(**st.secrets[“postgres”])
after running my file via streamlit run or as a python file, i am getting file not found error
FileNotFoundError: [Errno 2] No such file or directory:
‘C:\Users\E57036\Desktop\Python_Work\Streamlit_Dashboard\.streamlit\secrets.toml’