On Sun, Dec 18, 2011 at 1:57 PM, Thijs Engels <[email protected]> wrote:
> First of all, thank you very much for your response.
>
> In order to locate the 'issue', I did a complete new install (new
> virtualenv and easy_install pyramid). After the populate script, I tried
> running the example from the scaffold which is using Chameleon. This
> works, page is rendering fine, not issues whatsoever. One thing I did
> notice is this entry in 'Settings' from the debug toolbar:
>
>  mako.directories  []
>
> However some checking cleared up that this is added by the toolbar
> itself:
>
>  if not 'mako.directories' in config.registry.settings:
>    config.registry.settings['mako.directories'] = []
>
> After simply copying mytemplate.pt to mytemplate.mako in the templates
> directory (not sure whether parsing will be fine, but aiming at the
> initial exception), the deault views.py is changed to point to the mako
> template:
>
>  @view_config(route_name='home', renderer='templates/mytemplate.mako')
>
> Running this setup leaves us with the same error as indicated before:
>
>  mako.exceptions.TopLevelLookupException: Cant locate template for uri
>  'templates/mytemplate.mako'
>
> As suggested I added mako.directories to the development.ini, however
> the exception above remains. But as this already contains the
> 'templates' folder I changed the renderer to file name only:
>
>  @view_config(route_name='home', renderer='mytemplate.mako')
>
> And... success! Would this indeed be considered the recommended
> configuration for Mako?

I know that ``mako.directories = mypackage:templates`` combined with
``renderer="mytemplate.mako"`` works. I don't know if
``renderer="templates/mytemplate.mako"`` works because I'm not an
expert in asset specs. But it seems to be what the documentation
implies. Perhaps the documentation needs to be made clearer or is
wrong about asset specs working for Mako at this time.

-- 
Mike Orr <[email protected]>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to