I am doing a small task in Flask using template and render_template. Following is the code:
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def hello():
return render_template("index.html", body = "Hello World!!! I've run my first Flask application." )
Index.html file:
<html>
<body>
{{body}}
</body>
</html>
I tried to pass the string as raw:
return render_template("index.html", body = r"Hello World!!! I've run my first Flask application.")
But the Output is coming as:
Hello World!!! I've run my first Flask application.
Expected:
Hello World!!! I've run my first Flask application.