In a flask function which returns `send_file`, the code doesn't appear to run on subsequent requests, yet the file still downloads. Why?
问题 I am using a Flask Code with the following route: @app.route('/download') def download_file(): path = "certificate.docx" print("certificate printed") print(os.getcwd()) return send_file(path, as_attachment=True) HTML Code: <p> <a href="{{ url_for('.download_file') }}">Download</a> </p> This piece of code is being executed to download a file named certificate.docx . The problem is that the print statements inside the function download_file() are not actually being executed, yet it still allows