I would like to add an optional include in a bottle template.
Unfortunately this does not work as expected:
<foo>
% include(required_view)
<%
try:
include(optional_view)
except NameError:
pass
%>
</foo>
It does indeed make the optional import, but it stops after that.
(So </foo>
is missing from the result.)
I would like to allow for the variable optional_view
to be undefined.
Always adding 'optional_view': None
to the context would be annoying.
(Not to mention always adding an empty view.)