How do you host a multi-page Dash application on IIS?

Viewed 266

I am trying to host a multi-page Dash application on IIS for internal use at work. I have been able to get single-page Dash applications, such as below to work.

from flask import Flask
import dash
import dash_html_components as html
from dash.dependencies import Input, Output

server=Flask(__name__)
app = dash.Dash(__name__, suppress_callback_exceptions=True, show_undo_redo=True, server=server)
app.layout = html.Div([])
@app.callback(Output('page-content', 'children'),
              Input('url', 'pathname'))
def hello():
    return "Single page dash app works but not multi-page"
if __name__ == "__main__":
    app.run_server(host='0.0.0.0', port=84)

However, when I try to use it on multi-page dash applications, as described in the user manual here, it doesn't work correctly. I am able to host the application using Waitress, but would prefer something more stable and secure. IIS is how my company hosts other internal applications, so I was asked to host it that way. When attempting to use what I believe is the correct settings and handler mappings, I receive an error message on the page that simply says:

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

I believe that the issue is due to the fact that the flask application behind my Dash application is created in one script, and the entry point to the overall application is in another. I am not sure how to reconcile this, as the example page in the Dash documentation says that it must be this way.

So, how can I make this work?

cheers

0 Answers
Related