0Pricing
Flask Academy · Lesson

Pass Data into a Template

Send Python variables to the rendered page.

Pages That Change

Static HTML is fine, but real pages show different data per user. You make pages dynamic by passing data from your view into the template.

Keyword Arguments

Add keyword arguments to render_template. Each name you pass becomes a variable you can use inside the HTML file.

return render_template('hi.html', name='Ada')

All lessons in this course

  1. render_template and the templates Folder
  2. Pass Data into a Template
  3. Jinja2 Loops and Conditionals
  4. Autoescaping and the safe Filter
← Back to Flask Academy