Hey everyone, I'm trying out Django and i'm wondering where to access my env variables.
My LLM and stuff is adamantly suggesting i do like
# settings.py
SECRET_KEY = os.getenv("SECRET_KEY")
But my concern is that this is stringly typed, and if i start using a "SECRET_KEY" everywhere then if i rename the env variable i have to (i imagine) go searching through these strings.
I was thinking of having something like a config/env.py where i just do SECRET_KEY = os.getenv("SECRET_KEY") and then i can access it by variable anywhere. But my LLM is telling me that's not the 'standard' way.
Like in spring boot there is application.yaml where you have like
application:
secret-key: ${SECRET_KEY}
so then in the actual app i'm using application.secret-key instead of "SECRET_KEY", and my LSP can catch that it doesnt exist in application.yaml if i rename it. So i only need to worry about string mapping in the application.yml config.
I hope this makes sense, just wanted to ask if this env.py idea is standard or not, and if not why not?
Thanks in advance guys 🙏