# Project Overview

djapi is a Django 5.2 project providing financial data APIs for A-share stocks and CCTV news broadcast video processing.

## Tech Stack
- Python 3.10, Django 5.2, uWSGI, nginx
- Tushare (stock data), akshare (alternative stock data)
- DRF + drf-spectacular (API documentation)
- MySQL (business data), SQLite (Django admin only)
- yt-dlp + ffmpeg + pydub (video/audio processing)
- DashScope (ASR), DeepSeek API (AI text processing)

## Architecture
- Single Django app: `api`
- `api/stock/` — stock data module (Tushare/akshare -> pandas -> JsonResponse/DRF Response)
- `api/video/` — independent video processing pipeline (download -> audio -> ASR -> AI split -> MySQL)
- views.py is thin: extracts params, calls stock functions, returns Response

## Key Files
- `api/views.py` — all ~15 API views, using @api_view + @extend_schema
- `api/stock/stock_utils.py` — shared utilities: tscodeCheck, viewFunc_tsCodeAndDate, viewFunc_singleParam
- `api/stock/config.py` — Tushare token + re-exports from strategy_config, scan_config
- `api/serializers.py` — 13 DRF Serializer classes
- `djapi/env_loader.py` — .env file loader (stdlib, no python-dotenv)
- `api/video/env.py` — standalone .env loader for video module
- `api/utils/mysql_handler.py` — shared MySQLDB class

## Deployment
- Server: simon@doorcome.cn, path: /home/simon/myquant/djapi/
- Virtual env: /opt/miniconda/envs/django/
- uWSGI on port 5004, nginx reverse proxy
- Domains: api.doorcome.cn, echart.doorcome.cn
