Skip to content

load_dotenv() misbehaves with no parameters #111

@EmilyRagan

Description

@EmilyRagan

I do not have a settings.py file, so I am calling dotenv from my main.py, but it is still in the same folder as my .env file. Calling load_dotenv() without any parameters does not access the .env correctly, as every time that I try to use os.getenv to get an environment variable, it says "None". When I call load_dotenv(ENV_PATH) with ENV_PATH = Path(".") / ".env", it works.

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