PaperMate / run.py
ntphuc149's picture
fix: disable stdout buffering in run.py so pipeline logs appear in terminal
3e646a1
Raw
History Blame
732 Bytes
"""Quick-start script: python run.py"""
import os
import subprocess
import sys
from pathlib import Path
root = Path(__file__).parent
# Force UTF-8 stdout/stderr on Windows so Unicode log characters (→, ─, etc.)
# don't raise UnicodeEncodeError in the uvicorn console.
os.environ.setdefault("PYTHONUTF8", "1")
cmd = [
sys.executable, "-u", "-m", "uvicorn",
"backend.main:app",
"--reload",
"--host", "0.0.0.0",
"--port", "8000",
]
print("Starting PaperMate server at http://localhost:8000")
print("Home: http://localhost:8000/app/home.html")
print("Login: http://localhost:8000/app/login.html")
print("API docs: http://localhost:8000/docs")
print()
subprocess.run(cmd, cwd=str(root), env=os.environ)