Here is an example on how we can pass parameters to out html pages directly from Python. This was one of the features of Tornado that I fell in love with.
With very little code, we can get a web application running. In my experience this has been excellent for simple web apps, they are very stable, and very easy to maintain.
Even thought I used to run www.hedaro.com using Tornado, I do not really recommend you use it for your personal website. I would use Tornado for dashboards or for some sort of back-end tool.
Folder structure
root folder
- static
- templates
- index.html
- template.html
- app.py
App.py
Notice that I pass two parameters to the index.html page.
template.html
- {{ variable_name }} - notice how the double curly braces is how we are able to pass parameters from python to the html page.
index.html
Run the application