DougDougGithub / ChatGodApp

Simple web app that displays a Twitch chatter's messages on stream
MIT License
211 stars 35 forks source link

Use `dotenv` to enable easier environment variable modification #17

Open vabold opened 6 months ago

vabold commented 6 months ago

The pip package is python-dotenv. Its usage is very simple - whenever we need to access environment variables, we can load them from an external file called .env. Sample code has been provided on this package's PyPI page, but to summarize:

from dotenv import load_dotenv

load_dotenv()  # This will allow os.getenv to access these variables

The actual file will look something like this:

KEY1=VALUE1
KEY2=VALUE2

Integration should add a .gitignore file for .env to prevent leaks. The README also has implications that this has not been tested on non-Windows OSes - this is OS-agnostic.

CutestNekoAqua commented 5 months ago

Implementation should also provide a .env.example