Dash Page not opening up

1.8k views Asked by At

I have a small piece of code here below. The issue here is the Dash Page does not start up. It pops a small icon naming "Loading...." , and the Page doesnt show up. I have tried couple of things but nothing works.

import dash
import dash_core_components as dcc
import dash_html_components as html

app = dash.Dash()
app.layout = html.Div('Dash Tutorials')

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

The main problem is server does starts and No error is shown. Would be a great help if someone could sort the reasons for this. Thanks in Advance.

Regards, Nisarg

3

There are 3 answers

0
seny On

start the server from the project folder, not through the programming environment

0
Alexander Davydov On

This is probably a frontend/javascript code issue. Please check what's going on in the the browser via js console.

1
Michael Meuleman On

Your code looks correct. Just make sure that if you are running it from a virtual machine (or any machine outside of localhost) that you listen to the right IP.
So you can change it like this:

if __name__ == '__main__':
   app.run_server(debug=True, host='0.0.0.0', port='8050')

Setting my host=0.0.0.0 allows my server to listen to any IP, and you will use this URL:

http://<YourIp>:8050

You can check your IP via these commands:

$: ip addr / ifconfig

>: ipconfig