fix: run frontend without virtualenv
- Modify app.py to add vendor/ to sys.path so pip --target works. - Add frontend/.gitignore to exclude vendor/, __pycache__, thermopro.db. - Update README with pip --target instructions.
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
import json
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
|
||||
# Add vendor/ to the import path so pip --target dependencies are found.
|
||||
vendor_path = Path(__file__).parent / "vendor"
|
||||
if vendor_path.exists():
|
||||
sys.path.insert(0, str(vendor_path))
|
||||
|
||||
import requests
|
||||
from flask import Flask, jsonify, request, render_template
|
||||
|
||||
Reference in New Issue
Block a user