-
Notifications
You must be signed in to change notification settings - Fork 487
Open
Description
I have a .env file with this variables similar to those explained in the library README:
# Development settings
DOMAIN=example.org
ADMIN_EMAIL=admin@${DOMAIN}
ROOT_URL=${DOMAIN}/app
# base work directory
WORKDIR=/workdir_shared
# logdir
LOGDIR=${WORKDIR}/logs
When I run this script I see that the values of variables ${DOMAIN} and ${WORKDIR} are not applied. I get:
DOMAIN: example.org
ROOT_URL: ${DOMAIN}/app
ADMIN_EMAIL: admin@${DOMAIN}
WORKDIR: /workdir_shared
LOGDIR: ${WORKDIR}/logs
Whe it should be:
DOMAIN: example.org
ROOT_URL: example.org/app
ADMIN_EMAIL: [email protected]
WORKDIR: /workdir_shared
LOGDIR: workdir_shared/logs
What can be wrong?
This is the script code:
import os
from dotenv import load_dotenv
load_dotenv(verbose=True, interpolate=True)
print("DOMAIN:", os.getenv("DOMAIN"))
print("ROOT_URL:", os.getenv("ROOT_URL"))
print("ADMIN_EMAIL:", os.getenv("ADMIN_EMAIL"))
print("WORKDIR:", os.getenv("WORKDIR"))
print("LOGDIR:", os.getenv("LOGDIR"))I tried with "load_dotenv()" with same result.
Metadata
Metadata
Assignees
Labels
No labels