config.py 475 B

1234567891011121314151617181920
  1. import os
  2. class Settings:
  3. # 服务器配置
  4. HOST: str = "192.168.77.249"
  5. PORT: int = 7733
  6. # 基础 URL (返回给树莓派用于访问)
  7. BASE_URL: str = f"http://{HOST}:{PORT}"
  8. # 图片存储文件夹名称
  9. UPLOAD_DIR_NAME: str = "uploads"
  10. # 绝对路径
  11. BASE_DIR: str = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  12. UPLOAD_PATH: str = os.path.join(BASE_DIR, UPLOAD_DIR_NAME)
  13. settings = Settings()