This one is really really buggging me.
Will start by saying that everything is working perfectly on my local machine. On the server however, whatever I do ends up in a "Can not locate template for uri: ..."
On my local machine I use a Linux VM on Mac OS X. I have looked into case-sensitivity issues between file names. No dice.
I orignally had everything working by calling the files locally.
To confirm, I switched to using the mako.directories = app:templates
config and moved my templates directory from inside my app.views package to a app:template folder—which is a new folder names in lowercase.
On this configuration wasn't working.
I decided to be more explict.
So I called my mako files by doing:
@view_config(renderer='myapp:templates/template1.mak')
def template1(self):
pass
Still no dice.
Tried being explicit locally.
@view_config(renderer='templates/template2.mak')
def template2(self):
pass
Still failing.
And of course, when using mako.directories
in config, it still dosent work.
@view_config(renderer='template3.mak')
def template3(self):
pass
Is there a way to hook into this to see the specific filepath being called? Something much larger than 'templates/template.mak'?
For reference these are what the URI int the Pyramid TopLevelException looks like respectivley:
Exception
=========
"Can not locate template for uri %r" % uri)
mako.exceptions.TopLevelLookupException: Can not locate template for uri
========
'app:templates/template1.mak
'app.views:templates/template2.mak'