On Thu, Aug 22, 2013 at 07:51:32AM -0700, András JÁKÓ wrote:
>  Hi,
> 
> I'd like to use Mako templates in Pyramid 1.4.3 both with relative and 
> absolute pathnames, 
> but absolute ones don't seem to work.
> 
> http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/templates.html#using-templates-directly
>  
> discussing render_to_response states: "Although a renderer path is usually 
> just 
> a simple relative pathname, a path named as a renderer can be absolute, 
> starting 
> with a slash on UNIX..."However when I call render_to_response with e.g. 
> renderer_name='/usr/local/www/t.mako', I get:
> 
> TopLevelLookupException: Cant locate template for uri '/usr/local/www/t.mako'
> 
> (/usr/local/www/t.mako does exist and is readable by the user running pserve.)
> 
> Note that I also have mako.directories set, and relative pathnames (as well 
> as asset 
> specifications) work correctly.

IIRC Mako absolute template paths are actually relative to mako.directories.
(Whereas relative template paths are relative to the location of the
current template.)

Marius Gedminas
-- 
In order to get a loan you must first prove you don't need it.

Attachment: signature.asc
Description: Digital signature

Reply via email to