fork download
  1. from flask import Flask, render_template
  2.  
  3. app = Flask(__name__)
  4.  
  5. @app.route('/')
  6. def home():
  7. # Data to send to the HTML
  8. user_name = "Alice"
  9. fruit_list = ["Apple", "Mango"]
  10.  
  11. # Rendering the template and passing the data
  12. return render_template("index.html", name=user_name, fruits=fruit_list)
Success #stdin #stdout 0.11s 20820KB
stdin
Standard input is empty
stdout
Standard output is empty