✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

How to load html file directly on Dash


I am trying to load html file “test2.html” directly on Dash. Please how can I go about this, I have the following code snippet:

from flask import Flask
import flask
import webbrowser
import os

STATIC_PATH = os.path.join(os.path.dirname(os.path.abspath(file)), ‘static’)

server = Flask(name)
app = dash.Dash(name = name, server = server)

app.layout = html.Div(

def serve_static(path):
root_dir = os.getcwd()
return flask.send_from_directory(os.path.join(root_dir, ‘static’), path)

if name == ‘main’:
app.run_server(host=‘’, port=8090)

There is probably a better way to do what you are trying to do, but you can load raw HTML in using the https://github.com/plotly/dash-dangerously-set-inner-html package i made an example here with both statically loaded HTML and generated html from pandas

this doesnt work. can you show me an example?