Why there are two hpyerlinks of Dash is running with new dash 2.9.3?

Hi

I am using JupyterDash.

I just installed new Dash 2.9.3, then when I run below run_server, it create two hyperlinks. What are the difference between Dash is running and Dash app running? why there are 2 now? Thanks

if name == ‘main’:
app.run_server()

Dash is running on http://127.0.0.1:8050/

Dash app running on http://127.0.0.1:8050/

hi @roudan

Could it be that you have run server twice? Don’t forget to add the underscores around name and main

Try this code and see if it works correctly.

from dash import Dash, html

app = Dash(__name__)

app.layout = html.Div([
    html.Div(children='Hello World')
])

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

1 Like

Thanks Adam. Sorry for late reply. Yes your code in python file run fine. If I convert it to Jupyter Dash like below, then the result is the same with two hyperlink, can you try my below code to see how it look like in your pc? Also I do include two underscore for name and main. The below code after pasting here doen’t have underscore displayed, not sure why?

My code was running fine until recently I updated Dash to latest version. Thanks for your help.

from dash import Dash, html
from jupyter_dash import JupyterDash

# app = Dash(__name__)
app = JupyterDash(__name__,
                 external_stylesheets=[
                 "https://stackpath.bootstrapcdn.com/bootswatch/4.5.0/flatly/bootstrap.min.css"
                 ],
                 suppress_callback_exceptions=True
                 )

app.layout = html.Div([
    html.Div(children='Hello World')
])

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

Dash is running on http://127.0.0.1:8050/

Dash app running on http://127.0.0.1:8050/

did you try running the app with use_reloader=False?

Hi,why do you assign / declare two app variables. One with jupyterdash should be enough

1 Like

I edited the code formatting, the first line was actually commented out. Good spot however!

Hi @roudan
You’re correct. You should be getting two links to run the app.

Try to update the ending of your code from this:

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

To this:

app.run_server(mode='inline')

Thanks Adam. Yes it works now but I prefer not to use mode=inline. I would go back to use mode=external with two hyperlinks anyway. Thanks for your help. I appreciate it