I have used the flask-cors extension.
Install using pip install flask-cors
Then it’s simply
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
This will allow all domains
More Related Contents:
- Solve Cross Origin Resource Sharing with Flask
- CORS error on same domain?
- Get data from html and and pass the data back to the front end using ajax or js
- Python Flask Cors Issue
- JavaScript raises SyntaxError with data rendered in Jinja template
- Can scrapy be used to scrape dynamic content from websites that are using AJAX?
- jQuery XML error ‘ No ‘Access-Control-Allow-Origin’ header is present on the requested resource.’
- No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘…’ is therefore not allowed access
- Why am I seeing an “origin is not allowed by Access-Control-Allow-Origin” error here? [duplicate]
- No ‘Access-Control-Allow-Origin’ header is present on the requested resource error
- Why am I seeing an “origin is not allowed by Access-Control-Allow-Origin” error here? [duplicate]
- Understanding AJAX CORS and security considerations
- Why does the preflight OPTIONS request of an authenticated CORS request work in Chrome but not Firefox?
- AngularJS POST Fails: Response for preflight has invalid HTTP status code 404
- Flask – Calling python function on button OnClick event
- Pass parameter with Python Flask in external Javascript
- Rendering to JS with Jinja produces invalid number rather than string
- Pass JavaScript variable to Flask url_for
- Is CORS a secure way to do cross-domain AJAX requests?
- Cross Domain Resource Sharing GET: ‘refused to get unsafe header “etag”‘ from Response
- What’s to stop malicious code from spoofing the “Origin” header to exploit CORS?
- How to allow CORS in react.js?
- CORS cookie credentials from mobile WebView loaded locally with file://
- How to Detect Cross Origin (CORS) Error vs. Other Types of Errors for XMLHttpRequest() in Javascript
- Unable to pass jinja2 variables into javascript snippet
- Microsoft Edge blocked cross-domain requests sent to IPs in same private network CIDR
- Flask Dynamic data update without reload page
- XMLHttpRequest: Network Error 0x80070005, Access is denied on Microsoft Edge (but not IE)
- CORS error with jquery
- Passing variables from Flask to JavaScript