flask_cors is registered but still getting CORS error
Looks like an issue with trailing backslash. Your routes.py defines the route as '/sets'
however the frontend is calling '/sets/'
.
Change the routes.py to this and it should work -
from flask import request, jsonify, current_appfrom . import app, dbfrom .models import SetAnon
@app.route('/sets/', methods=['POST']) # Added trailing backslashdef sets(): data = request.get_json() _set = SetAnon( col1=data['somedata'] ) db.session.add(_set) db.session.commit() return "set saved", 201