Spaces:
Sleeping
Sleeping
Refactor database connection parameters to use simplified secret keys for improved clarity and maintainability.
Browse files
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.
|
| 100 |
-
port=int(st.secrets.
|
| 101 |
-
user=st.secrets.
|
| 102 |
-
password=st.secrets.
|
| 103 |
-
database=st.secrets.
|
| 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
|