Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use WindowPath in read_env() method #286

Closed
Moon-developer opened this issue Jan 18, 2021 · 1 comment
Closed

Can't use WindowPath in read_env() method #286

Moon-developer opened this issue Jan 18, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@Moon-developer
Copy link

Using pathlib's Path object to generate a path to a file on windows can't get read by the read_env method.

Before:

env_file = Path.joinpath(BASE_DIR, ".env")
if Path(env_file).is_file():
    env.read_env(env_file)

After:

env_file = Path.joinpath(BASE_DIR, ".env")
if Path(env_file).is_file():
    env.read_env(env_file.as_posix()) # Work around

Wondering if library can be updated to handle WindowsPath object too?

@sergeyklay
Copy link
Collaborator

This is resolved in develop branch. Thank you for the report, and for helping us make django-environ better. And I am sorry about the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants