Read more
from flask import Flask, render_template_string
app = Flask(__name__)
product_data = {
"name": "boAt Bassheads 100",
"price": 299.00,
"description": "Awesome earphones",
"image": "static/product.jpg" # Assuming you have a product.jpg in static folder
}
HTML_TEMPLATE = """
Product Page
"""
@app.route("/")
def product_page():
return render_template_string(HTML_TEMPLATE, product=product_data)
if __name__ == "__main__":
app.run(debug=True)
{{ product.name }}
${{ product.price }}
{{ product.description }}
0 Reviews