Biking is great and sometimes hard to begin when the other option is coding. :-)

My approach would be to import template.py as a module which is able to do the work. Now I see, it has everything in __init__, so not very flexible, and needs a page generator.