Files
OnlineJudge/pyproject.toml
yuetsh 989b33d827 refactor: 移除 2FA 功能与三个冗余依赖
2FA 早已是死代码:TOTP 相关端点标注为前端未调用,前端唯一的
two_factor_auth 是硬编码 false,没有任何入口能打开它。

- 删除 TwoFactorAuthAPI、CheckTFARequiredAPI、_totp* 辅助函数、
  TwoFactorAuthCodeSerializer 及各 serializer 的 tfa_code 字段
- 删除管理端写 two_factor_auth/tfa_token 的分支。登录已不再校验
  TOTP,若保留写入路径,置 True 会变成静默的安全降级
- 删除 User.two_factor_auth / tfa_token 字段(迁移 0009)
- 移除 django-dbconn-retry:仅挂在 INSTALLED_APPS,代码零引用。
  DATABASES 未配置 CONN_MAX_AGE(默认 0),本就没有持久连接需要
  重连修复。要开持久连接用 Django 自带的 CONN_HEALTH_CHECKS
- requests 换成 httpx(openai 已经引入):删除废弃的
  ReleaseNotesAPI,judge dispatcher 显式传 timeout=None 以保持
  requests 原本的无超时行为,判题请求是同步等结果的

依赖净减 5 个:otpauth、qrcode、requests、charset-normalizer、
django-dbconn-retry

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 23:00:45 -06:00

50 lines
1.0 KiB
TOML

[project]
name = "onlinejudge"
version = "2.0.0"
description = ""
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"channels>=4.3.2,<5",
"channels-redis>=4.3.0,<5",
"uvicorn[standard]>=0.34.0,<1",
"django>=6.0.4,<6.1",
"django-dramatiq>=0.15.0,<0.16",
"django-redis>=6.0.0,<7",
"djangorestframework>=3.17.1,<4",
"dramatiq>=2.1.0,<3",
"gunicorn>=26.0.0,<27",
"httpx>=0.28.1,<1",
"openai>=2.34.0,<3",
"pillow>=12.2.0,<13",
"psycopg>=3.3.4,<4",
"psycopg-binary>=3.3.4,<4",
"python-dateutil>=2.9.0.post0,<3",
"sentry-sdk[django]>=2.0.0,<3",
"tree-sitter>=0.25.2",
"tree-sitter-c>=0.24.2",
"tree-sitter-python>=0.25.0",
"xlsxwriter>=3.2.9,<4",
"asgiref>=3.11.1",
"jieba>=0.42.1",
]
[dependency-groups]
dev = [
"ruff>=0.15.11",
]
[tool.pyright]
venvPath = "."
venv = ".venv"
[tool.ruff]
line-length = 180
exclude = ["*/migrations/*", "*settings.py", "*/apps.py", ".venv"]
[tool.ruff.format]
quote-style = "double"
[tool.ruff.lint]
select = ["E", "F", "I"]