老板/研发要求:有报错时把真因抓出来,做成前端友好提示。 - 捕获真实错误体(openai_compatible._raise_with_body):取代 raise_for_status()。 yunqi 的真因(moderation_blocked / safety_violations=[sexual])只在 body 里, 原来只剩状态行「400 Bad Request for url」→ 真因长期不可见。现在完整抓出。 - friendly_generation_error():把原始报错翻成中文友好提示(内容审核/超时/限流/ 凭证/参考图被拒…),前端直接展示;原始报错留 task.error_message 供研发排查。 - 故事板失败:友好提示存 shot.error_message;并撤回「重试 400」——审核拦截重试 也是白拦,改成快速失败+提示,引导用户改措辞(如避免「胸罩/内衣/抚摸/贴身」)。 - 前端:失败帧缩略图加红色「⚠失败」角标(hover 看原因),主视图显示完整友好提示; 不再灰着没反应。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
AirShelf Backend
All backend code lives under AirShelf/core/backend by project decision.
Local bootstrap
cd /Users/maidong/Desktop/zyc/qiyuan_gitea/AirShelf/core/backend
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
Start workers in separate terminals:
cd /Users/maidong/Desktop/zyc/qiyuan_gitea/AirShelf/core/backend
source .venv/bin/activate
celery -A airshelf worker -l info -P threads -c 4 # 线程池 4 并发(出图/视频可并行;勿用 -P solo 串行)
ffmpeg must be available on PATH for Stage5 export jobs.
Runtime layout
- Django project:
airshelf - Domain apps:
apps/* - Settings module:
airshelf.settings.development - Celery app:
airshelf.celery
Secrets must be supplied by environment variables or .env; never commit values from account.md.
Useful commands
python manage.py check
python manage.py makemigrations --check --dry-run
python manage.py migrate
python manage.py bootstrap_volcano_models
python manage.py test apps.accounts apps.projects apps.billing