Fix dashboard imports for Streamlit multi-page routing
- Add sys.path.insert at top of app.py and all 5 page files - Fix .streamlit/config.toml CORS/XSRF conflict - Remove duplicate st.set_page_config from page files - Verified: all pages import cleanly, dashboard boots via streamlit run - All 49 tests passing (31 original + 18 dashboard)
This commit is contained in:
@@ -3,6 +3,14 @@
|
||||
Multi-page Streamlit app. Run with: streamlit run dashboard/app.py
|
||||
"""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Ensure project root is on path so 'dashboard' imports resolve
|
||||
PROJECT_ROOT = Path(__file__).resolve().parent.parent
|
||||
if str(PROJECT_ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(PROJECT_ROOT))
|
||||
|
||||
import streamlit as st
|
||||
|
||||
from dashboard.viz.components import inject_css
|
||||
|
||||
Reference in New Issue
Block a user