Flask - Background Tasks
Examine the following Flask code snippet:
What is the error in this code?
from flask import Flask
import threading
app = Flask(__name__)
@app.route('/start')
def start_task():
def task():
print('Task executed')
threading.Thread(target=task).run()
return 'Task started'What is the error in this code?
