I did an "easy_install mako" on a Windows machine with TG already
installed and working.

My code for my controllers.py is simply:
from turbogears import controllers, expose, flash
from turbogears import identity, redirect
from cherrypy import request, response

class Root(controllers.RootController):
    @expose(template="mako:makotest.templates.test")
    def index(self):
        return dict()

There is a file makotest\templates\test.mak. When I do python start-
makotest.py, everything runs ok until I connect and then I get the
following traceback:

500 Internal error
The server encountered an unexpected condition which prevented it from
fulfilling the request.

Page handler: <bound method Root.index of <smqt.controllers.Root
object at 0x01391B10>>
Traceback (most recent call last):
  File "c:\python25\lib\site-packages\cherrypy-2.2.1-py2.5.egg\cherrypy
\_cphttptools.py", line 105, in _run
    self.main()
  File "c:\python25\lib\site-packages\cherrypy-2.2.1-py2.5.egg\cherrypy
\_cphttptools.py", line 254, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in index
  File "c:\python25\lib\site-packages\TurboGears-1.0.3.2-py2.5.egg
\turbogears\controllers.py", line 344, in expose
    *args, **kw)
  File "<string>", line 5, in run_with_transaction
  File "c:\python25\lib\site-packages\TurboGears-1.0.3.2-py2.5.egg
\turbogears\database.py", line 312, in so_rwt
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File "c:\python25\lib\site-packages\TurboGears-1.0.3.2-py2.5.egg
\turbogears\controllers.py", line 359, in <lambda>
    mapping, fragment, args, kw)))
  File "c:\python25\lib\site-packages\TurboGears-1.0.3.2-py2.5.egg
\turbogears\controllers.py", line 399, in _execute_func
    return _process_output(output, template, format, content_type,
mapping, fragment)
  File "c:\python25\lib\site-packages\TurboGears-1.0.3.2-py2.5.egg
\turbogears\controllers.py", line 86, in _process_output
    fragment=fragment)
  File "C:\Python25\lib\site-packages\turbogears-1.0.3.2-py2.5.egg
\turbogears\view\base.py", line 129, in render
    return engine.render(**kw)
  File "C:\Python25\lib\site-packages\mako-0.1.10-py2.5.egg\mako\ext
\turbogears.py", line 48, in render
    template = self.load_template(template)
  File "C:\Python25\lib\site-packages\mako-0.1.10-py2.5.egg\mako\ext
\turbogears.py", line 44, in load_template
    return self.lookup.get_template(templatename)
  File "c:\python25\lib\site-packages\mako-0.1.10-py2.5.egg\mako
\lookup.py", line 72, in get_template
    raise exceptions.TopLevelLookupException("Cant locate template for
uri '%s'" % uri)
TopLevelLookupException: Cant locate template for uri '/smqt/templates/
test.mak'
Powered by CherryPy 2.2.1

When I googled the error I found some posts to this mailing list dated
Jan 07 that described my problem, but also mentioned that the fix for
it had been committed, and that everything should work if I set
mako.directories to my template directory in my config file.

So I put mako.directories="makotest.templates" in my app.cfg, and
still a 500 error. I tried mako.directories="makotest/templates",
mako.directories="makotest\templates" all without luck.

I'm positive I'm not the only one to ever tread down this road. Does
anyone know what I need to do to get mako to render templates without
throwing 500 at me every time? Thank you.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to