From 9f24897791c7ed645f29081cf32f0ab9f47b5887 Mon Sep 17 00:00:00 2001 From: OpenSquared Date: Sat, 18 Jul 2026 17:30:47 +0200 Subject: [PATCH] feat: saxo connector --- backend/main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/main.py b/backend/main.py index 29e89f7..4688640 100644 --- a/backend/main.py +++ b/backend/main.py @@ -1,5 +1,10 @@ +import os +from pathlib import Path from dotenv import load_dotenv -load_dotenv() +# Explicit path: don't rely on the process's current working directory (a systemd +# unit, pm2, or a launcher script may start uvicorn from somewhere other than +# backend/), otherwise .env silently fails to load and SAXO_APP_KEY/SECRET stay unset. +load_dotenv(dotenv_path=Path(__file__).resolve().parent / ".env") from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware @@ -27,7 +32,6 @@ from routers import strategy_builder as strategy_builder_router from routers import saxo_oauth as saxo_oauth_router from routers import saxo as saxo_router from services.database import init_db, get_config, cleanup_stale_running_cycles -import os import logging import uvicorn