How to add access environment variables in python


so I was trying to acces environment variables in python but when I run it, the project cant and access environment variables even though I added them in. How do you access secrets in python in replit.

replit code

#password is py secret 35
from os import getenv
responce = ""
def login():
  responce = input("enter password: ").strip()
  if responce == getenv("password"):
    return True
    return False
def mainlogin():
  while True:
    logincorrect = login()
    if logincorrect:
      print("you have hacked into this project now go to " + getenv("website url"))
      print("wrong password")

when signed in console picture
signed in console picture

not signed in console picture
Screenshot 2023-03-27 3.01.35 PM

secret key tab

project link](

Hey there! Can I see screenshots of your secrets tab? (not the secrets themselves, just the secrets keys)

added the secrets tab

You cant access secrets outside of the Repl editor (correct me if I’m wrong)

Secrets can only be accessed if you’re signed in to the account that owns the repl.

Repls on the cover page do not share secrets with the host repl, I think the only way to keep them set is to define them in the .replit file, or hardcode it into the code.