Deploying Dash app on a 'local' server (with external access) securely

Viewed 10481

I am part of a project that I would like to deploy a Dash web app for, hosting on a server from one of the project partners. Is there a way to securely (I guess with basic dash auth) share this Dash app with other members of the project through a URL?

I know this can be deployed through Heroku, but as there may be concerns with data moving through this third-party service, a more ideal setup would be to host the app through a 'local' (to the project) server.

Effectively

  • Dash app is built and deployed through git on a 'local' & 24/7 operated server
  • and, project partners can access the app via a provided URL

I am SURE there is something out there on this but I can't seem to pinpoint the deployment method that will best suit our needs.

1 Answers

If you run the dash app on 0.0.0.0:8050 then your partner can access the app from the same wifi network if they go to your computer's ip_address:8050 on their web browser.

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

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

Therefore if you local ip address was 192.168.7.98 your co-worker could access the running dash app by going to 192.168.7.98:8050 from the same wifi network. This is a great method for testing mobile layouts as well. Fire up dash on 0.0.0.0 and access it from your phone using the same method described above.

Here are all the options that are available in the run_server method:

    def run_server(
        self,
        host=os.getenv("HOST", "127.0.0.1"),
        port=os.getenv("PORT", "8050"),
        proxy=os.getenv("DASH_PROXY", None),
        debug=False,
        dev_tools_ui=None,
        dev_tools_props_check=None,
        dev_tools_serve_dev_bundles=None,
        dev_tools_hot_reload=None,
        dev_tools_hot_reload_interval=None,
        dev_tools_hot_reload_watch_interval=None,
        dev_tools_hot_reload_max_retry=None,
        dev_tools_silence_routes_logging=None,
        dev_tools_prune_errors=None,
        **flask_run_options):
Related