H
5

PSA: I spent a whole day trying to get my code to run because I didn't know about environment variables.

I was in my apartment in Chicago, trying to connect my Python script to a database. It kept failing with an error I didn't understand. After six hours of checking my code, I realized I had typed my database password directly into the script instead of using a separate file. I moved the password to a .env file and it worked right away. Has anyone else had a simple setup issue waste a huge amount of time?
3 comments

Log in to join the discussion

Log In
3 Comments
anthony_fox90
Disagree on the extra steps thing. It's like locking your door instead of leaving it wide open. Saves way more time than it costs.
7
the_anna
the_anna1mo ago
Oh man, I used to put my keys right in the code too. Felt like such a dumb mistake when I finally learned about .env files.
4
julia843
julia8431mo ago
Honestly though, .env files just feel like extra steps sometimes.
3