Unable to pass variables to html using Flask (python)

2 weeks ago 15
ARTICLE AD BOX

I'm trying to set up a webpage using flask so that i can pass python variables to the html page. I created a test python file, with a 'page.html' file inside a 'templates' folder. I used the render_template function and passed it a variable 'number', to be displayed on the page by referencing it in the html file (using {{number}} inside <p> tags). Instead of displaying the value of the variable, it displays the text {{number}}. I've seen other people online do the exact same thing and it works, does anyone know why it doesn't for me? I'm using VS code and the python 3.13.9 interpreter (installed from microsoft store).

Images attached of all of the above.

Image of my python file

Image of my html file

Image of the webpage when I run the python project

The python interpreter I'm using

Read Entire Article