app.py
from flask import Flask, render_template
import random
app = Flask(__name__)
@app.route("/")
def index():
number = random.randint(0, 10)
return render_template("index.html", value='number')
templates/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Random Number</title>
</head>
<body>
Your random number is {{ value }}.
</body>
</html>
Webpage Result
Your random number is number.
It isnt replacing the number with actual number. Kindly help!
BTW i am coding this in PyCharm