Working with flask template

  • Create few templates(name: index.html,result.html)
  • Create a folder give access to template(folder name- templates)

First open your visual studio code — in visual studio code – view – TERMINAL

Activate your virtualenv – venv/scripts/activate

Run program- python

Create two file – index.html and result.html

Create folder – templates (move both file “index.htmland result.html inside templates folder )

(and template folder move to flask folder(make sure your main folder))



Create new file “”

Run your python file


Copy paste IP address your browser:

Working with models

  • Creating a variable to data.
  • Accessing the variable from our template.

Create one variable

Result.html :- also we change in html file

Run program: python

Output:- hello mr “harry”

Open chat