Flask: multiple Dash apps & html templates together

Hello.

The goal is to be able to run multiple Dash apps (dashboards) as well as load .html templates using Flask - so basically to have a website with pages and Dash dashboards.

For running multiple Dash apps I used approach suggested by [chriddyp] (Profile - chriddyp - Plotly Community Forum) in this topic.

Structure:

  • app.py
  • index.py
  • apps
    |-- init.py
    |-- app1.py
    |-- app2.py

For returning .html templates in Flask I used:

from flask import Flask, render_template
import dash
from app import server
server=Flask(name)

@server.route(‘/about/’)
def about():
return render_template(“about.html”)

if name==“main”:
app.run_server(debug=True)

The question is how to combine these both techniques in one if the structure is the following?

  • app.py
  • index.py
  • apps
    |-- init.py
    |-- app1.py
    |-- app2.py
  • templates
    |-- home.html
    |-- about.html
1 Like

Hi, you can see my example code for Flask_template_auth_with_Dash :slightly_smiling_face: