Futuresony commited on
Commit
9a6cded
·
verified ·
1 Parent(s): 3494099

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
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
- db_host = os.getenv("DB_HOST")
52
- db_name = os.getenv("DB_NAME")
53
- db_user = os.getenv("DB_USER")
54
- db_password = os.getenv("DB_PASSWORD")
55
- db_port = os.getenv("DB_PORT", "5432") # Default PostgreSQL port
 
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]):