Practical server side includes with Python on Google App Engine
-
25-05-2021 - |
Question
Is there a decent way to "simulate" server side includes using Python on Google App Engine?
I would really like to split my static html files up into smaller pieces for two reasons:
- They will be easier to manage from a development perspective
- HTML that is redundant across multiple pages can be more easily re-used and updates to the HTML will show on all pages instead of having to copy and paste updates
Solution
Just use template library (Jinja2 is pre-installed on GAE). "Getting started" doc provides examples.
What you want to use instead of SSI is template inheritance.
OTHER TIPS
Or use a framework like django, which will help in inheritance of templates.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow