Env variables to access Postgres DB

Saved environment variables (under Env Groups in the dashboard) for Postgres password/host. When calling them in app via os.getenv() I am getting a:

Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Database is hosted in Render and seems to be running. What am I missing here?

Did you link the environment group to the service that’s connecting to your Postgres DB?