Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Bokeh Plot Problem

Hi all, I'm trying to have two bokeh plots in a flask app with bootstrap columns. I need two.

They are setup as an html and one is loading fine and the other is not showing up.

In my main app.py:

#tell flask to read dashboard page
@app.route('/dashboard')
def dashboard():
# Read content of plot1.html
    with open("plot1.html", "r") as f:
        plot1_html = f.read()
   
    # Read content of plot2.html
    with open("plot2.html", "r") as f:
        plot2_html = f.read()
   
    # Pass both plots to the template
    return render_template("dashboard.html", plot1_html=plot1_html, plot2_html=plot2_html)

In the dashboard.html:

 <!-- map and chart in bootstrap setup-->
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-6">
     

/r/flask
https://redd.it/1gkiu8s