[default] app.name = "{{ cookiecutter.project_name }}" app.version = "{{ cookiecutter.project_name }}" app.description = "基于 FastAPI 和 Tortoise-ORM 的 {{ cookiecutter.project_name }} 打包脚手架" app.debug = false env = "production" [database] type = "sqlite" generate_schemas = true # 生产环境使用迁移工具 [database.sqlite] engine = "tortoise.backends.sqlite" file_path = "db.sqlite3" journal_mode = "WAL" busy_timeout = 10000 maxsize = 10 minsize = 1 cache_size = -2000 synchronous = "NORMAL" temp_store = "MEMORY" mmap_size = 1073741824 foreign_keys = true auto_vacuum = "INCREMENTAL" max_cached_statements = 100 readonly = false [security] secret_key = "your-secret-key-change-in-production" algorithm = "HS256" access_token_expire_minutes = 30 refresh_token_expire_days = 7 [jwt_cache] enabled = true db_path = "./cache" cleanup_interval_hours = 24 max_sessions_per_user = 5 [development] env = "development" debug = true [development.server] host = "127.0.0.1" port = 8000 reload = true # workers = 4 [development.logging] level = "DEBUG" file = "logs/dev.log" [development.cors] allow_origins = ["*"] allow_credentials = true allow_methods = ["*"] allow_headers = ["*"] [production] env = "production" debug = false [production.server] host = "0.0.0.0" port = 8000 reload = false workers = 1 [production.logging] level = "INFO" file = "logs/prod.log" [production.cors] allow_origins = ["https://yourdomain.com", "http://localhos:8000", "http://127.0.0.1:8000"] allow_credentials = true allow_methods = ["GET", "POST", "PUT", "DELETE"] allow_headers = ["Authorization", "Content-Type"] [production.module_system] type = "module-bank" path = ["resources/app.mbank", "resources/plugins.mbank"] [production.file_system] type = "svfs" path = "resources/application.vfs" [cache] default_ttl = 300