MENG21 commited on
Commit
6fb0ecc
·
1 Parent(s): 69ba836

Refactor database connection parameters to use simplified secret keys for improved clarity and maintainability.

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -96,11 +96,11 @@ def get_user_info(credentials):
96
  # Remove the load_data function and replace with database connection
97
  def get_db_connection():
98
  return mysql.connector.connect(
99
- host=st.secrets.db.host,
100
- port=int(st.secrets.db.port),
101
- user=st.secrets.db.user,
102
- password=st.secrets.db.password,
103
- database=st.secrets.db.database
104
  )
105
 
106
  # Main function to run the Streamlit app
 
96
  # Remove the load_data function and replace with database connection
97
  def get_db_connection():
98
  return mysql.connector.connect(
99
+ host=st.secrets.host,
100
+ port=int(st.secrets.port),
101
+ user=st.secrets.user,
102
+ password=st.secrets.password,
103
+ database=st.secrets.database
104
  )
105
 
106
  # Main function to run the Streamlit app