Yet another question about flask and jquery autocomplete. I have been reading and trying the following answered questions without any success:
Flask AJAX Autocomplete
It doesn't work because a missprint in a suggested piece of code:
from flask import jsonify
NAMES=["abc","abcd","abcde","abcdef"]
@app.route('/autocomplete',methods=['GET'])
def autocomplete():
search = request.args.get('term')
Change in search = request.args.get('term') 'term' to 'autocomplete'. So correct code should be as follow:
from flask import jsonify
NAMES=["abc","abcd","abcde","abcdef"]
@app.route('/autocomplete',methods=['GET'])
def autocomplete():
search = request.args.get('autocomplete')