Answer the question
In order to leave comments, you need to log in
Why doesn't CORS work in Flask?
app = Flask(__name__)
cors = CORS(app, resources={r'*': {'origins': ['https://therighthairstyles.com']}})
r = Redis()
@app.after_request
def add_header(response):
if response.status_code == 200:
response.cache_control.max_age = EXPIRES
else:
response.cache_control.no_cache = True
return response
@app.route('/')
def index():
return render_template('index.html')
@app.route('/photo', methods=['GET', 'POST'])
def upload():
if request.method == 'POST':
if 'photo' not in request.files:
return abort(400, description='There isn\'t photo field')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question