init
This commit is contained in:
@@ -1,17 +1,14 @@
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
try:
|
||||
os.chdir(os.path.dirname(sys.argv[0]))
|
||||
except Exception:
|
||||
pass
|
||||
BACKEND_DIR = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
class Config(BaseSettings):
|
||||
DEBUG_MODE: bool = True
|
||||
WORKERS: int = 1
|
||||
PORT:int = 27173
|
||||
PORT: int = 27173
|
||||
MCPPORT: int = 27174
|
||||
REDIS_URL: str = 'redis://localhost:6379/1'
|
||||
COLG_TOKEN: str = ''
|
||||
@@ -19,7 +16,11 @@ class Config(BaseSettings):
|
||||
HELPER_ID: str = ''
|
||||
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=('config/.env', 'config/.env.dev', 'config/.env.prod'),
|
||||
env_file=(
|
||||
str(BACKEND_DIR / 'config' / '.env'),
|
||||
str(BACKEND_DIR / 'config' / '.env.dev'),
|
||||
str(BACKEND_DIR / 'config' / '.env.prod'),
|
||||
),
|
||||
extra='ignore',
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user