Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

flask cors

from flask import Flask
from flask_cors import CORS

app = Flask(__name__)
CORS(app, resources={r"*": {"origins": "*"}})
Comment

install flask_cors

$ pip install flask-cors
Comment

cors flask

@app.route("/", methods=["GET"])
def get_example():
    """GET in server"""
    response = jsonify(message="Simple server is running")

    # Enable Access-Control-Allow-Origin
    response.headers.add("Access-Control-Allow-Origin", "*")
    return response
Comment

PREVIOUS NEXT
Code Example
Python :: python exception element not found 
Python :: python find smallest element in dictionary 
Python :: python os make empty file 
Python :: ImportError: matplotlib is required for plotting when the default backend "matplotlib" is selected. 
Python :: pandas rename index 
Python :: ERROR: Failed building wheel for Pillow 
Python :: python get absolute path of file 
Python :: pyttsx3 save to file 
Python :: jupyter clear cell output programmatically 
Python :: Flask Gmail 
Python :: read google sheet from web to pandas python 
Python :: argparse boolean default 
Python :: installing django 
Python :: pandas shuffle rows 
Python :: absolute value columns pandas 
Python :: python cd to directory 
Python :: python selenium run javascript 
Python :: rmse in python 
Python :: convert pandas dataframe to spark dataframe 
Python :: pandas read_csv ignore unnamed columns 
Python :: python discord bot join voice channel 
Python :: how to install pandas datareader in conda 
Python :: python time now other timezone 
Python :: how to count docx pages python 
Python :: plot specific columns pandas 
Python :: model load pytorch 
Python :: open chrome in pyhton 
Python :: pip install arcpy python 3 
Python :: tkinter how to disable window resizing 
Python :: how to create dynamic variable names in python 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =