I'm trying to set environment variables within a Python virtual environment in VS Code (mostly for API keys). The VS Code documentation here: https://code.visualstudio.com/docs/python/environments suggests that Python will automatically detect a .env file within a workspace folder. However, that doesn't seem to be happening. When I enter the following code, the terminal returns a value of None.
import os
SHEETY_ENDPOINT = os.getenv("SHEETY_ENDPOINT")
SHEETY_TOKEN = os.getenv("SHEETY_TOKEN")
I'm using the dotenv package to make the code work right now, but don't want to have to rely on it if it is unnecessary in a VS Code workspace.