juancamval commited on
Commit
2d45620
·
verified ·
1 Parent(s): 4d462ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -70,4 +70,21 @@ user_input = st.text_input("What graphics do you have in mind")
70
  generate_button = st.button("Generate")
71
 
72
  if generate_button and user_input:
73
- st.write(load_data())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  generate_button = st.button("Generate")
71
 
72
  if generate_button and user_input:
73
+ if not SUPABASE_URL or not SUPABASE_KEY:
74
+ print("Error: Supabase URL and/or Key not found in environment variables.")
75
+
76
+ else:
77
+ supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY)
78
+
79
+ try:
80
+ # Try a simple query - fetching all rows from a basic table (adjust table name)
81
+ response = supabase.table("your_test_table").select("*").limit(1).execute()
82
+
83
+ if response.error:
84
+ print(f"Supabase connection test failed with error: {response.error}")
85
+ else:
86
+ print("Supabase connection test successful!")
87
+ print("First row from 'your_test_table':", response.data)
88
+
89
+ except Exception as e:
90
+ print(f"An unexpected error occurred during Supabase connection test: {e}")