Changing the favicon in Flask/Dash
To simply change the favicon
all you need to do is to create a folder called assets
next to your app.py and place your favicon.ico
inside of that folder and it will work perfectly.
app.py:
import flaskimport dashimport dash_html_components as htmlserver = flask.Flask(__name__)@server.route('/')def index(): return 'Hello Flask app'app = dash.Dash( __name__, server=server, routes_pathname_prefix='/dash/')app.layout = html.Div("My Dash app")if __name__ == '__main__': app.run_server(debug=True)
Here is the docs link for more information: Dash docs
You can just put title="My Title"
as an argument when establishing the Dash app instance. i.e.
app = dash.Dash( __name__, title="My Title", server=server, routes_pathname_prefix='/dash/')
An alternative used in Dash is:
app = dash.Dash()app._favicon = ("path_to_folder/(your_icon).co")