rewrited logic structure

This commit is contained in:
2026-09-09 16:43:57 +08:00
parent 1947a27514
commit ac6d2cf3b4
20 changed files with 1717 additions and 1496 deletions

17
group_system/config.py Normal file
View File

@@ -0,0 +1,17 @@
"""运行配置和环境变量。"""
from __future__ import annotations
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
DB_PATH = Path(os.environ.get("GROUP_DB", BASE_DIR / "selfgroup.db"))
XLSX_PATH = Path(os.environ.get("GROUP_XLSX", BASE_DIR / "2025mt.xlsx"))
STATIC_DIR = BASE_DIR / "static"
TEACHER_USER = os.environ.get("TEACHER_USER", "teacher")
TEACHER_PASSWORD = os.environ.get("TEACHER_PASSWORD", "teacher!@#")
GROUP_LIMIT = 6
SESSION_DAYS = 7
MAX_JSON_BYTES = 1024 * 1024
MAX_UPLOAD_BYTES = 10 * 1024 * 1024