This commit is contained in:
theliu
2026-04-26 20:05:33 +08:00
commit 5ff0c575a1
21 changed files with 2507 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import os
from datetime import timedelta
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'dev-secret-key-change-in-production'
USERS_FILE = 'users.json'
UPLOAD_FOLDER = 'static/uploads'
MAX_CONTENT_LENGTH = 100 * 1024 * 1024 # 100MB
MAX_SIMULTANEOUS_FILES = 5
SESSION_PERMANENT = True
PERMANENT_SESSION_LIFETIME = timedelta(days=7)
# WebSocket配置
SOCKETIO_ASYNC_MODE = 'eventlet'
@staticmethod
def init_app(app):
# 确保上传目录存在
if not os.path.exists(Config.UPLOAD_FOLDER):
os.makedirs(Config.UPLOAD_FOLDER)