diff --git a/main.py b/main.py index 7ed1e04..9f72d18 100644 --- a/main.py +++ b/main.py @@ -415,6 +415,10 @@ def custom_post(): else: flash('使用投組功能請先登入。', 'warning') return redirect(url_for('login')) + + # Ensure plotly backend is set + pd.options.plotting.backend = "plotly" + port = pd.read_csv(request.files['csv_file'], index_col=0, parse_dates=True) role = request.form.get('role') lookback = int(request.form.get('lookback')) @@ -538,6 +542,10 @@ def result_view(): else: sid = request.args.get('strategy_id') strategy_id = request.args.get('strategy_id') + + # Ensure plotly backend is set (fixes Railway deployment issue) + pd.options.plotting.backend = "plotly" + sql="""select * from strategy where id=%s;""" conn = psycopg2.connect(**SQL_CONFIG) with conn: