flask to execute other tasks after return render_template flask to execute other tasks after return render_template flask flask

flask to execute other tasks after return render_template


As suggested in the comments, you should use apply_async().

@app.route("/myprocess", methods=['POST'])def myprocess():    #.... do work    r = checkJob.apply_async()    return render_template('confirm.html')

Note that, as with the example, you do not want to invoke checkJob() but rather keep it like checkJob.