Black Lives Matter. Please consider donating to Black Girls Code today.

Python Dash Framework Networking

I’m learning Dash library for creating dashboards. I’m in Dash Tutorial - Part 1: App Layout

When i run my app.py file in cmd. It shows: Running on http://127.0.0.1:8050/ (Press CTRL+C to quit). Then i can open app in my web brower at the SAME computer using url it give me.

But it doesn’t work when i open it in other computer’s browser using same URL.

I thought my app using dash as a server. So when the program is running anyone can open it in their own computer browser. But appearently it’s not the case.

I want to create a web application so that when i run anyone can open. But i’m not familiar with computer networking at all. Is this a proxy server problem? What can i do?

To make your app available from the outside you need to set the host to be 0.0.0.0. This is not specific to Dash, but common to hosting such web apps in general. To do this using the developemnt server:

app.run_server(host='0.0.0.0')

1 Like

Hello nedned,

Thanks for replying so fast. But i still got problem. I can’t access on any computer now after using host “0.0.0.0”. Not even on my own :frowning:

This site can’t be reached
The webpage at http://0.0.0.0:8050/ might be temporarily down or it may have moved permanently to a new web address.
ERR_ADDRESS_INVALID

Router problem? I use wifi.

I think app.run_server(host='0.0.0.0') supposed to be part of your code, but you should run the url with the ip of the computer you’re working on, and any other computer in your network would run the app.

1 Like

It seems worked! Basically run hosting computer’s IP Address on other computer’s browser plus :portalnumber of course. Thank you very much.

One more thing, the app seems running very slowly if i use chrome on other computers. Also only on Chrome. I think it’s because i’m running it in my laptop. What is the standard process to run web app in industry? Running it on a physical server? I want to deplore my app on a large scale in the future so overload and other issues come into play.

Right, you don’t reference 0.0.0.0 anywhere, that just tells the server to make it available to the outside. To access locally, you continue to use localhost as before.

1 Like