Files
ca_auto_table/back/settings.py
2025-11-20 11:42:18 +08:00

35 lines
1.2 KiB
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.

TORTOISE_ORM = {
'connections': {
'default': {
# 'engine': 'tortoise.backends.asyncpg', PostgreSQL
'engine': 'tortoise.backends.mysql', # MySQL or Mariadb
'credentials': {
'host': '192.168.11.67',
'port': 3306,
'user': 'country',
'password': 'sWdFeXMmAbHE5MXj',
'database': 'country',
'minsize': 10, # 最小连接数设为10避免连接过多
'maxsize': 30, # 最大连接数设为30避免超出数据库限制
'charset': 'utf8mb4',
"echo": False,
'pool_recycle': 3600, # 增加连接回收时间从300秒到3600秒(1小时)
'connect_timeout': 10, # 连接超时时间
}
},
},
'apps': {
'models': {
# 仅注册实际存在的模型模块,移除不存在的 apis.project.models避免 Aerich 初始化失败
'models': [
"apis.country.models",
"aerich.models"
],
'default_connection': 'default',
}
},
'use_tz': False,
'timezone': 'Asia/Shanghai'
}