Spaces:
No application file
No application file
Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ DB_HOST = "https://wziqfkzaqorzthpoxhjh.supabase.co"
|
|
28 |
#DB_USER = os.getenv("DB_USER")
|
29 |
DB_USER = "postgres"
|
30 |
#DB_PASSWORD = os.getenv("DB_PASSWORD")
|
31 |
-
DB_PASSWORD = "Me21322972.........."
|
32 |
#DB_PORT = os.getenv("DB_PORT", "5432") # Default PostgreSQL port
|
33 |
DB_PORT = "5432"
|
34 |
|
@@ -48,11 +48,12 @@ def connect_db():
|
|
48 |
"""Establishes a connection to the PostgreSQL database."""
|
49 |
print("Attempting to connect to the database...")
|
50 |
# Retrieve credentials inside the function in case environment variables are set after import
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
56 |
|
57 |
|
58 |
if not all([db_host, db_name, db_user, db_password]):
|
|
|
28 |
#DB_USER = os.getenv("DB_USER")
|
29 |
DB_USER = "postgres"
|
30 |
#DB_PASSWORD = os.getenv("DB_PASSWORD")
|
31 |
+
DB_PASSWORD = "Me21322972.........." # Replace with your actual password
|
32 |
#DB_PORT = os.getenv("DB_PORT", "5432") # Default PostgreSQL port
|
33 |
DB_PORT = "5432"
|
34 |
|
|
|
48 |
"""Establishes a connection to the PostgreSQL database."""
|
49 |
print("Attempting to connect to the database...")
|
50 |
# Retrieve credentials inside the function in case environment variables are set after import
|
51 |
+
# Use the hardcoded global variables defined above for this test
|
52 |
+
db_host = DB_HOST
|
53 |
+
db_name = DB_NAME
|
54 |
+
db_user = DB_USER
|
55 |
+
db_password = DB_PASSWORD
|
56 |
+
db_port = DB_PORT
|
57 |
|
58 |
|
59 |
if not all([db_host, db_name, db_user, db_password]):
|