Use Jinja2 templates to render HTML in Flask

InstructorWill Button

Share this video with your friends

Send Tweet

In this lesson, you'll get a quick introduction on how to use Jinja2 templates to render HTML using a Flask server in Python. Topics covered:

  • Where to store your HTML templates
  • How to pass variables to the Jinja2 template
  • How to render the resulting HTML in Flask
mrudula14
~ 6 years ago

Hi Will, I am working on project which is created in Django and jinja2 template And I need to convert Jinja2 to Angular6. Any idea how I can do this?

Will Buttoninstructor
~ 6 years ago

I haven't used Angular6 (or 5, 4, 3... actually it looks like the last time I used Angular was 5 years ago) I'm not sure there is a straight conversion it might actually be more of a "recreate this project in Angular". It looks like there may be some options for adding Angular support, then converting components from Jinja2 to Angular one at a time (to avoid a heavy lift and replace): https://realpython.com/flask-by-example-integrating-flask-and-angularjs/