From 4330ddd33889ae1f6194853858c2c1af6ebc54be Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Tue, 17 Mar 2026 08:13:17 +0800 Subject: [PATCH] update --- CLAUDE.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index af101dd..fa0ad4b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -23,7 +23,13 @@ uv add # Add a dependency python manage.py test # Run all tests python manage.py test account # Run tests for a single app python manage.py test account.tests.TestClassName # Run a single test class -coverage run manage.py test && coverage report # Run with coverage +python run_test.py # Run flake8 lint + coverage in one step +python run_test.py -m account # Run flake8 + tests for a single module +python run_test.py -c # Run flake8 + tests + open HTML coverage report + +# Initial setup +python manage.py inituser --username admin --password --action create_super_admin +python manage.py inituser --username admin --password --action reset ``` ## Architecture @@ -45,6 +51,8 @@ Each Django app follows the same structure: Apps: `account`, `problem`, `submission`, `contest`, `ai`, `flowchart`, `problemset`, `class_pk`, `announcement`, `tutorial`, `message`, `comment`, `conf`, `options`, `judge` +`utils/` is itself a Django app (listed in `INSTALLED_APPS`) — not just a helpers package. It provides `RichTextField` (XSS-sanitized `TextField`), `APIError`, the base `APIView`, caching, WebSocket helpers, and the `inituser` management command. Import shared utilities from `utils.*`. + ### URL Routing All routes are registered in `oj/urls.py`: @@ -128,4 +136,4 @@ Test cases and submission outputs are stored in a separate data directory (confi ## Related Repository -The frontend is at `D:\Projects\ojnext` — a Vue 3 + Rsbuild project. See its CLAUDE.md for frontend details. +The frontend is at `../ojnext` — a Vue 3 + Rsbuild project. See its CLAUDE.md for frontend details.