path_conf.py 693 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. import os
  4. from pathlib import Path
  5. # 获取项目根目录
  6. # 或使用绝对路径,指到backend目录为止,例如windows:BasePath = D:\git_project\fastapi_mysql\backend
  7. BasePath = Path(__file__).resolve().parent.parent
  8. # alembic 迁移文件存放路径
  9. ALEMBIC_Versions_DIR = os.path.join(BasePath, 'alembic', 'versions')
  10. # 日志文件路径
  11. LOG_DIR = os.path.join(BasePath, 'log')
  12. # 离线 IP 数据库路径
  13. IP2REGION_XDB = os.path.join(BasePath, 'static', 'ip2region.xdb')
  14. # 挂载静态目录
  15. STATIC_DIR = os.path.join(BasePath, 'static')
  16. # jinja2 模版文件路径
  17. JINJA2_TEMPLATE_DIR = os.path.join(BasePath, 'templates')