fix env import lookup

main
MrWaradana 2 days ago
parent eba0d1565f
commit 022d2d0fc7

@ -34,8 +34,16 @@ def get_env_tags(tag_list: List[str]) -> dict:
def get_config(): def get_config():
try: try:
# Try to load from .env file first # Try to load from .env file in the project root
config = Config(".env") project_root = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
env_path = os.path.join(project_root, ".env")
if os.path.exists(env_path):
config = Config(env_path)
else:
# Fallback to default behavior (current working directory)
config = Config(".env")
except FileNotFoundError: except FileNotFoundError:
# If .env doesn't exist, use environment variables # If .env doesn't exist, use environment variables
config = Config(environ=os.environ) config = Config(environ=os.environ)

Loading…
Cancel
Save