fix: 基础目录设置

This commit is contained in:
lan
2024-01-18 18:31:11 +08:00
parent ab1d3e1718
commit 029307acce
+4 -2
View File
@@ -4,7 +4,8 @@
# @Software: PyCharm # @Software: PyCharm
from pathlib import Path from pathlib import Path
data_root = Path('./data') BASE_DIR = Path(__file__).resolve().parent.parent
data_root = BASE_DIR / 'data'
if not data_root.exists(): if not data_root.exists():
data_root.mkdir(parents=True, exist_ok=True) data_root.mkdir(parents=True, exist_ok=True)
env_path = data_root / '.env2' env_path = data_root / '.env2'
@@ -78,4 +79,5 @@ class Settings:
def items(self): def items(self):
return self.__dict__.items() return self.__dict__.items()
settings = Settings()
settings = Settings()