Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Multiple Inputs/Outputs Errors when deploy on IIS

Hi,

When I try to run the app on IIS with multiple inputs and single output situation, it keeps showing ‘Updating’ with no graph display. The same problem exists when there are multiple outputs. I can run the script with no problem locally, but it appears when I run on IIS. Does anyone have similar issues?

This usually means that an exception was raised in the callback. You can verify this by looking at your browser’s console or network tab and you’ll see a 500 level error.
Unfortunately, there aren’t very good remote debugging tools in dash yet (besides logging in to the server and inspecting the terminal for erros)

Hi Chris,

Thanks for the prompt reply. I am still not sure how should I fix the issue. Below is the error message I got from browser’s console, any idea?

Ah OK, I see the 403 error. That’s related to not having a secret_key. This is used for CSRF protection. If you want CSRF protection, set:

import os
server.secret_key = os.environ.get('secret_key', 'secret')

and set an environmental variable called secret_key to a random secret string of characters (it will default to 'secret' if it isn’t available). See “How to generate good secret keys” here: http://flask.pocoo.org/docs/0.12/quickstart/#sessions

You can skip CSRF protection with
app = dash.Dash(__name__, csrf_protect=False)

It works!

Thanks so much!