Permitting CORS in Flask Permitting CORS in Flask flask flask

Permitting CORS in Flask


try this:

#Add these importsfrom flask import jsonifyfrom flask_cors import CORS#Add an app level config in this formatapp = Flask(__name__)CORS(autoINFER_app, resources={r"/*": {"origins": "*"}}, send_wildcard=True)#While returning the GETs add this lineresponse = jsonify(all_dict)response.headers.add('Access-Control-Allow-Origin', '*')return response

This should take care of all permutations which might cause this.