Secret data to env file

Hi, I need to hide some data (string) from GIT and trying this:(get from web)

  • mylib.py (from dotenv import load_dotenv
    load_dotenv())

  • created .env file (and added the data there)
    dbhost=“1.1.1.1”
    dbuser=“fulan”
    dbpass=“sudxnilfxlminzselfinsldnd==”
    dbport=“3307”
    dbname=“master”

Now when I try to access the data:
*** Settings ***
Library mylib.py

*** Variables ***
${dbhost} %{dbhost}

*** Test Cases ***
Case 1 get value from env
${dbhost}= Get Variable Value ${dbhost}
log to console dbhost: ${dbhost}

log to console dbuser: %{dbuser}
log to console dbpass: %{dbpass}
log to console dbport: %{dbport}
log to console dbname: %{dbname}

That one does not work.
Undefined environment variable: dbhost

Undefined environment variable: dbuser robotframework

What am I missing? Is the location of .env file important?

Should I see the values with:
Get Environment Variables

Or should I go with this:

Any help is appreciated

I have a .env file in the root directory of my project. In my tests directory I have a

__init__.robot

file with the following:

*** Settings ***
Library      dotenv
Suite Setup  Load Dotenv

And of course Python-dotenv installed :grinning:

Thank you for your answer. I will try ^that also.
Now I have already go with the cryptoLibrary and seems that I got it working