ㅇ Changes: - Introduced the DART strategy to the trading system, including its configuration and integration into the existing framework. - Updated the database schema to include DART-specific tables for disclosures and watchlists. - Enhanced the backtesting and parameter search functionalities to support the DART strategy. - Implemented new rules for browser verification and API interactions to ensure compliance with the updated DART strategy. Impact: - These additions expand the trading capabilities of the system, allowing for more comprehensive analysis and execution of DART-related strategies, while maintaining system integrity and performance.
59 lines
2.6 KiB
Plaintext
59 lines
2.6 KiB
Plaintext
---
|
|
description: 백테 웹 수정 후 systemctl 재시작 + 브라우저로 열어 클릭 검증까지 완료
|
|
alwaysApply: true
|
|
---
|
|
|
|
# 백테 웹 재시작 + 브라우저 검증 (필수)
|
|
|
|
`backtest_web.py` · `templates/backtest.html` · `static/js/backtest.js` · `kis_trader/web/**` 등 **웹 UI/API에 반영되는 코드**를 수정한 뒤에는:
|
|
|
|
1. 사용자에게 “재시작/새로고침하세요”만 말하지 말고 **직접 재시작**
|
|
2. **페이지를 띄워 관련 UI를 눌러보는 검증까지** 끝낸 뒤에야 “완료”로 보고
|
|
|
|
`curl 200` / `systemctl active` 만으로는 검증 완료가 **아님**. 콘솔 `ReferenceError`·버튼 미동작은 브라우저 클릭 없이는 놓친다.
|
|
|
|
## 0) 🚨 브라우저 URL — 절대 고정 (로컬호스트 금지)
|
|
|
|
| 용도 | URL |
|
|
|------|-----|
|
|
| **브라우저 검증 (필수)** | **`http://192.168.0.149:5050/`** |
|
|
| curl/헬스체크 (서버 로컬만) | `http://127.0.0.1:5050/` |
|
|
|
|
- Cursor 브라우저·에이전트는 **`127.0.0.1` / `localhost` 로 열지 말 것** → `chrome-error` / 접속 실패.
|
|
- **항상** `http://192.168.0.149:5050/` 로 navigate·스냅샷·클릭.
|
|
- 모델이 바뀌어도 이 주소만 쓴다. “로컬이면 127” 추측 **금지**.
|
|
|
|
## 1) 재시작
|
|
|
|
```bash
|
|
sudo systemctl restart kis_backtest_web.service
|
|
sleep 2
|
|
systemctl is-active kis_backtest_web.service
|
|
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:5050/
|
|
```
|
|
|
|
- 유닛: `kis_backtest_web.service` (포트 **5050**)
|
|
- 실패 시: `journalctl -u kis_backtest_web.service -n 40 --no-pager`
|
|
- curl 은 서버 쪽 헬스용. **브라우저 검증 URL 과 혼동하지 말 것.**
|
|
|
|
## 2) 브라우저 검증 (수정 범위만큼)
|
|
|
|
브라우저 도구로 **`http://192.168.0.149:5050/`** 만 연다. (`127.0.0.1` 금지)
|
|
|
|
- 강력 새로고침에 해당하는 방식으로 최신 JS/HTML 로드
|
|
- **수정한 탭·버튼·날짜 인풋·정렬·거래내역**을 실제로 클릭/입력
|
|
- DevTools 콘솔에 `Uncaught` / `ReferenceError` / 빨간 네트워크 실패가 **없어야** 함
|
|
- 스냅샷으로 화면 상태 확인 후, 잔여 오류가 있으면 고치고 재검증
|
|
|
|
최소 산출물(보고에 포함):
|
|
|
|
- 재시작 결과 (`active` + HTTP 코드)
|
|
- 연 URL (**반드시** `http://192.168.0.149:5050/…`) + 누른 탭/버튼
|
|
- 콘솔 오류 유무 (없으면 “콘솔 오류 없음”)
|
|
|
|
## 언제
|
|
|
|
- Python API/서버 변경 → 재시작 **필수** + 브라우저 검증
|
|
- `static/` · `templates/` 만 변경 → 재시작(또는 캐시 무효) + **브라우저 검증 필수**
|
|
- 실매 봇(`kis_trader_main` 등)은 웹과 무관하면 재시작하지 말 것
|