How do you set page title?

Nobody wants an app called Dash. So what is the method to set the page title?

app.title = 'abc' definitely isn’t working for me. I had it working for a little while using

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


def mydashapp(path):
    app.title = "xyz"
    return app.index()

as recommended on this forum but I have started using dash-bootstrap-components and now it is permanently back to Dash. Getting this settable per-page would be even better if that were possible.

Hi @marketemp, app.title should be the way to go. Could you please share here a minimal app where it’s not working with app.title? For example I checked with the minimal code below and it works as expected (ie the title is displayed in the title bar of the browser and in the tab)

import dash
import dash_html_components as html

app = dash.Dash(__name__)
app.title = "my title"

app.layout = html.Div(html.H2("This is my app"))

if __name__ == '__main__':
    app.run_server(debug=True, port=8052)

haha, just as you were replying, I noticed that app.title actually working on my externally hosted instance on FireFox/Chrome/Safari and on Chrome and Safari on the OSX Instance I am working from. The only exception is it still says Dash on the Firefox browser on my development machine. This is where I spend 99% of my time and why I thought it wasn’t working anywhere. I won’t worry about that from here on out.

Here’s a peek - I am 100% positive these two instances are running the same code. The one on the left is hosted from the machine itself and the one on the right is hosted from an AWS machine.

Screen Shot 2020-05-26 at 5.31.26 PM

thanks Emanuelle!

1 Like

If you want to set it dynamically, you can have a look there in the section Update the Document Title Dynamically based off of the URL or Tab