I am getting this error message when attempting to...
# help
u
I am getting this error message when attempting to connect to Supabase table.
n
Hello ! This thread has been automatically created from your message in a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
u
@User, hey how are you guys doing?
n
🆕 raise Exception(supabase_url is required)
u
So cool lol
main.py
Copy code
python
import os
from supabase import create_client, Client

url: str = os.environ.get("SUPABASE_URL")
key: str = os.environ.get("SUPABASE_KEY")
supabase: Client = create_client(url, key)
variable.env
Copy code
env
export SUPABASE_URL="https://stuqhyhalkjsylaquudg.supabase.co"
export SUPABASE_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InN0dXFoeWhhbGtqc3lsYXF1dWRnIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTY0ODY1NzQ0MSwiZXhwIjoxOTY0MjMzNDQxfQ.VBNzLcLOoJ0dCl4jmlc0II_lDZGCoogrH0ylpsCJ6XE"
g
I don't use python, but seems like your code is not passing the url to the client init from the error. Is there a way to "console.log" your url and key right before you init the client?
n
raise Exception(supabase_url is required)
u
Oh my god, I'm so dumb lol
Gary thank you so much
main.py
Copy code
python
import os
from supabase import create_client, Client
import dotenv

dotenv.load_dotenv('variable.env')

url: str = os.environ.get("SUPABASE_URL")
key: str = os.environ.get("SUPABASE_KEY")
supabase: Client = create_client(url, key)
data = supabase.table("table_name").select("*").execute()
# Assert we pulled real data.
assert len(data.data) > 0

print(data)
Missing file name lol
Copy code
python
dotenv.load_dotenv('variable.env')
g
@User So I can add python to my resume now?😂
u
Yes lol
Actually, dude, Python is like so easy
You should give it a shot, you will be suprised.
What gets me is the syntax for like that library
Also it's not in the documentation
So not so intelligente people like me don't get it right away XD
n
Thread was archived by @アレラーノ・ケビン. Anyone can send a message to unarchive it.