Alter mako-render to add template_dir directories to sys.path

Declined
#3 · Created  · Last updated

Declined pull request

No longer relevant

Closed by: ·2014-04-29

Description

The python interpreter will prepend sys.path with the parent directory of the script it is running (or the current directory if the script comes from stdin).

It would be nice for mako-render to behave similarly. As it stands, we cannot easily import local python modules (via the <namespace> tag) that sit along side templates. Thus a template can't import helper functions that have been defined in a python module, unless we manage to put that module into the "global" python path.

This patch extends my previous patch, that added --template-dir, to also add these directories to the python path

0 attachments

0 comments

Loading commits...