1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Is there a way to change the path to the .env file?

Discussão em 'Python' iniciado por Stack, Setembro 10, 2024.

  1. Stack

    Stack Membro Participativo

    I used to have the following project structure:

    | *other files.py*
    | main.py
    | .env


    Then, I decided to sort the files into directories. The structure turned out to be as follows:

    | src
    | ∟ *other files.py*
    | | main.py
    | | .env


    Everything worked before that. After that, when I try to get an environment variable, I get None. If you return .env to the directory above, as it was before, everything works again.

    Is there a way to change the path to the .env file without decouple?

    I rescheduled .env the file to another folder and would like to receive a variable, not None.

    Continue reading...

Compartilhe esta Página