How to use environment variables

I have added environment variables in my runpod serverless endpoind, the thing is i cant reach then inside the pod, i have defined it like this in the UI: key. | value SOME_KEY | keyvaluehere and in the code i am trying to use them like this: ENVIRONMENT_KEY_CONSTANT = os.getenv("SOME_KEY", "") WHAT AM I DOING WRONG HERE
1 Reply
Encyrption
Encyrption2mo ago
I think it should be like this:
ENVIRONMENT_KEY_CONSTANT = os.environ.get("SOME_KEY", "")
ENVIRONMENT_KEY_CONSTANT = os.environ.get("SOME_KEY", "")
Although, I think your version should work also... What is the value of ENVIRONMENT_KEY_CONSTANT after doing the assignment?
Want results from more Discord servers?
Add your server