Download app/database.py from isold/MeloonTop: direct link, hf CLI and curl.
- Browser
- Download file 576 Bytes
-
https://huggingface.co/spaces/isold/MeloonTop/resolve/main/app/database.py
- Command line
-
hf download hf://spaces/isold/MeloonTop/app/database.py
-
curl -L -o database.py https://huggingface.co/spaces/isold/MeloonTop/resolve/main/app/database.py
576 Bytes
| import os | |
| from dotenv import load_dotenv | |
| from supabase import create_client, Client | |
| load_dotenv() | |
| SUPABASE_URL = os.getenv("SUPABASE_URL") | |
| SUPABASE_KEY = os.getenv("SUPABASE_KEY") | |
| if not SUPABASE_URL or not SUPABASE_KEY: | |
| print("Warning: SUPABASE_URL and SUPABASE_KEY are not set in environment variables.") | |
| # Create the Supabase client | |
| # Ensure that the env vars are available before using the client | |
| try: | |
| supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY) | |
| except Exception as e: | |
| supabase = None | |
| print(f"Error initializing Supabase client: {e}") | |