From 411ee81f39638a0e6caa1edf7f4db63a17d5c6f9 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 27 May 2026 18:46:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E6=A0=B9=E7=9B=AE=E5=BD=95=E5=88=B0sys.path=EF=BC=8C=E8=A7=A3?= =?UTF-8?q?=E5=86=B3entcms=E6=A8=A1=E5=9D=97=E5=AF=BC=E5=85=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/cms.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/cms.py b/app/cms.py index cdd4737..537d24a 100644 --- a/app/cms.py +++ b/app/cms.py @@ -4,8 +4,13 @@ """ import os, sys +# 添加应用根目录到Python路径 +app_dir = os.path.dirname(os.path.abspath(__file__)) +root_dir = os.path.dirname(app_dir) +sys.path.insert(0, root_dir) + # Ensure app/ is in path for local imports -sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +sys.path.insert(0, app_dir) from appPublic.log import MyLogger, info from appPublic.folderUtils import ProgramPath