The mod_include module supporting server side includes (SSI), provides a means of registering new element tags which trigger callouts to other code in separate Apache modules. This is used for example in mod_perl to allow Perl language code to be used with server side includes:
<!--#perl sub="MySSI::remote_host" -->
<!--#perl arg="Hello" arg="SSI" arg="World"
An equivalent feature for Python was previously asked about on the mailing list back in 2004:
Since it seems entirely reasonable that such integration of mod_python and mod_include would be possible, thought it would be good to log it as a possible new feature.
Because of SSI's support for basic conditionals, includes and other callout mechanisms, would be a good quick and dirty way of doing templating without having to resort to PSP, or other high level templating systems.