Files
dtm-py-all/UI/config.py

18 lines
581 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
全局配置文件
用于控制数据库访问方式等全局设置
"""
# ===================== 数据库访问配置 =====================
# True: 使用 HTTP API 访问数据库(避免多线程竞争)
# False: 直接访问 SQLite 数据库
# 已优化:使用 requests.Session() 连接池,性能提升 10-20 倍
USE_HTTP_API = True # 已优化,可以启用
# Flask 后端 HTTP API 地址
# 注意Windows 下 localhost DNS 解析慢(~2秒必须使用 127.0.0.1
HTTP_API_BASE_URL = "http://127.0.0.1:5050"