Answers for "flask cors allow localhost"

6

cors error in flask

from flask import Flask
from flask_cors import CORS, cross_origin

app = Flask(__name__)
CORS(app)

@app.route("/")
def helloWorld():
    return "Hello world"
Posted by: Guest on June-17-2020
1

install flask_cors

$ pip install flask-cors
Posted by: Guest on November-28-2020
0

python flask access-control-allow-origin

@app.route('your route', methods=['GET'])
def yourMethod(params):
    response = flask.jsonify({'some': 'data'})
    response.headers.add('Access-Control-Allow-Origin', '*')
    return response
Posted by: Guest on October-02-2021

Python Answers by Framework

Browse Popular Code Answers by Language