fix: 添加应用根目录到sys.path,解决entcms模块导入问题
This commit is contained in:
parent
569c8e6715
commit
411ee81f39
@ -4,8 +4,13 @@
|
|||||||
"""
|
"""
|
||||||
import os, sys
|
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
|
# 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.log import MyLogger, info
|
||||||
from appPublic.folderUtils import ProgramPath
|
from appPublic.folderUtils import ProgramPath
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user