title: Is storing project configuration in environment variables a bad practice?
body: <p>Some background first:
  i am currently testing a class that sends a GET request with a configurable url, which is built like this</p>
  
  <pre><code>url = f"{os.environ["TARGET_URL"]}/api/etc"
  </code></pre>
  
  <p>For normal operation, my <code>TARGET_URL</code> environment variable is set at project startup from a .env file and everything works. When testing locally, everything is still fine, tests passes and everyone is happy. My issue arose when I discovered that my Drone CI server failed to complete the project's build because the <code>TARGET_URL</code> environment variable wasn't found.</p>
  
  <p>After some digging I found out that I had the wrong (dumb) idea that environment variables were reset at every project/test startup, and I basically was using my production environment variable all this time (even during tests) because it was set at first project startup.</p>
  
  <p>From this story comes my question: <em>given that environment variables are kept between executions, would storing configurations in them result in a bad practice? Is there an equally convenient alternative (no global objects and access from everywhere in the code) that can be used instead?</em></p>