def predict():
    if request.method == 'POST':
        try:
            data = request.get_json()
            print(data)
            file_name = data['filename']
            print(file_name)
            res = inte.main_function('.', file_name)
        except ValueError:
            return jsonify("Please enter filename.")

        return jsonify(res)
Beispiel #2
0
def upload_file():
    if request.method == 'POST':
        f = request.files['file']
        f.save(secure_filename(f.filename))
        print("File upload successful")
    try:
        file_name = secure_filename(f.filename)
        print(file_name)
        res = inte.main_function('.', file_name)
    except ValueError:
        return jsonify("Please enter filename.")
    res_data = json.dumps(res)
    return render_template('lumino/charts.html', res_data=res_data)