I've seen that you can enable CORS for Flask (How to enable CORS in flask), but I have a Dash app and I want to enable something like
headers = { 'Access-Control-Allow-Origin':'*' }
Does anyone know how to do it?
I've seen that you can enable CORS for Flask (How to enable CORS in flask), but I have a Dash app and I want to enable something like
headers = { 'Access-Control-Allow-Origin':'*' }
Does anyone know how to do it?
You can enable CORS on Dash by using flask_cors
Here a snippet you could try:
import dash
from flask_cors import CORS
app = dash.Dash(__name__)
server = app.server
CORS(server)
@app.route("/")
def helloWorld():
return "Hello, cross-origin-world!"
At this link https://flask-cors.readthedocs.io/en/latest/ you can find the documentation for the Flask-CORS library with instructions regarding how to install and configure it