Skip to content

Use dotenv to enable easier environment variable modification #17

@vabold

Description

@vabold

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions