Files
chongming_template_fastapi/{{ cookiecutter.project_name }}/public/config.toml
T

92 lines
1.9 KiB
TOML
Raw Normal View History

2026-01-31 16:36:09 +08:00
[default]
2026-04-29 11:24:19 +08:00
app.debug = false
app.description = "基于 FastAPI 的 {{ cookiecutter.project_name }} 打包脚手架"
2026-01-31 16:36:09 +08:00
app.name = "{{ cookiecutter.project_name }}"
2026-03-06 14:30:10 +08:00
app.version = "0.1.0"
2026-01-31 16:36:09 +08:00
env = "production"
2026-04-29 11:24:19 +08:00
prefix = "/api/v1"
upload_path = "uploads"
2026-01-31 16:36:09 +08:00
[database]
2026-04-29 11:24:19 +08:00
generate_schemas = true # 生产环境使用迁移工具
type = "sqlite"
url = "sqlite+aiosqlite:///./data/database.db"
2026-01-31 16:36:09 +08:00
2026-01-31 19:26:28 +08:00
[database.sqlite]
2026-04-29 11:24:19 +08:00
connect_args.check_same_thread = false
connect_args.timeout = 15
echo = false
echo_pool = false
2026-03-06 14:30:10 +08:00
max_overflow = 10
pool_pre_ping = true
2026-04-29 11:24:19 +08:00
pool_recycle = 300
pool_size = 20
pool_timeout = 30
[scheduler]
job_store_path = "scheduler_jobs.db"
[cache]
cache_store_path = "./"
2026-01-31 19:26:28 +08:00
2026-01-31 16:36:09 +08:00
[security]
access_token_expire_minutes = 30
2026-04-29 11:24:19 +08:00
algorithm = "HS256"
2026-02-02 13:36:57 +08:00
max_sessions_per_user = 5
2026-04-29 11:24:19 +08:00
refresh_token_expire_days = 7
secret_key = "your-secret-key-change-in-production"
2026-01-31 16:36:09 +08:00
[development]
debug = true
2026-04-29 11:24:19 +08:00
env = "development"
2026-01-31 16:36:09 +08:00
[development.server]
2026-04-29 11:24:19 +08:00
access_log = false
2026-01-31 16:36:09 +08:00
host = "127.0.0.1"
2026-03-06 14:30:10 +08:00
port = 8001
2026-01-31 16:36:09 +08:00
reload = true
[development.logging]
2026-04-29 11:24:19 +08:00
file = "logs"
2026-03-06 14:30:10 +08:00
format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
2026-04-29 11:24:19 +08:00
level = "DEBUG"
2026-01-31 16:36:09 +08:00
[development.cors]
allow_credentials = true
allow_headers = ["*"]
2026-04-29 11:24:19 +08:00
allow_methods = ["*"]
allow_origins = ["*"]
2026-01-31 16:36:09 +08:00
[production]
debug = false
2026-04-29 11:24:19 +08:00
env = "production"
2026-01-31 16:36:09 +08:00
[production.server]
2026-04-29 11:24:19 +08:00
access_log = false
2026-01-31 16:36:09 +08:00
host = "0.0.0.0"
port = 8000
reload = false
2026-04-29 11:24:19 +08:00
timeout_keep_alive = 65
2026-03-06 14:30:10 +08:00
workers = 4
2026-01-31 16:36:09 +08:00
[production.logging]
2026-04-29 11:24:19 +08:00
backup_count = 5 # 最多保存 10 个日志文件
file = "logs"
format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
level = "INFO"
max_size = 10485760 # 10MB
2026-01-31 16:36:09 +08:00
[production.cors]
allow_credentials = true
allow_headers = ["Authorization", "Content-Type"]
2026-04-29 11:24:19 +08:00
allow_methods = ["GET", "POST", "PUT", "DELETE"]
allow_origins = ["https://yourdomain.com", "http://localhost:8000", "http://127.0.0.1:8000"]
2026-01-31 16:36:09 +08:00
[production.module_system]
path = ["resources/app.mbank", "resources/plugins.mbank"]
2026-04-29 11:24:19 +08:00
type = "module-bank"
2026-01-31 16:36:09 +08:00
[production.file_system]
2026-04-29 11:24:19 +08:00
path = "static.svfs"
2026-01-31 16:36:09 +08:00
type = "svfs"