Displaying a .txt file in Flask [duplicate] Displaying a .txt file in Flask [duplicate] flask flask

Displaying a .txt file in Flask [duplicate]


I think your question should be "How to display a .txt file content inside an html pre tag with Flask" instead of yours, cuz It is little different meaningAlthough just watching your code, You only have to send the correct context keyword to the template, like @alexander-santos said too:

return render_template("book.html", text=content)