Seth schrieb:
> Thanks for throwing TG 1.1 into the list. I'm pretty sure CherryPy is
> expected to be faster than the Paste server, so I ran your 1.1 test
> app on my mod_wsgi setup and came up with the following: http://bit.ly/1czNm3

So how did you do this exactly? Did you wrap the cherrypy app in a wsgi
app and configured this for mod_wsgi?

> For some reason I could not get Mako working. There's a paste link
> with the output there in the above link. I'm not at all familiar with
> TG 1.x setup so I'm probably just doing something stupid.

Hmm, can't tell from your traceback, what went wrong. You seem to have
all the right package versions. If I look at the code in your zip, and
can see no obvious changes that could have broken something. Have you
checked the permissions on the 'hello.mak' file?

I had similar problems with the Jinja2 plugin first, which I solved the
good old fashioned way by inserting a print statements in the failing
function and the ones calling it, to see what went wrong. Turned out
that Jinja2 was expecting the path to the templates in the configuration
and only the basename of the template in the expose decorator. But it's
not like that for mako, because on my system it works like genshi.

What I find suspicious in the exception you pasted:

TopLevelLookupException: Cant locate template for uri
'/helloworld/templates/hello.mak'

is, that it gives an absolute path for the template.

Btw, I cheated a little bit in the raw_sql method, where I transformed

        output = ''
        hello = DBSession.query(model.Hello).all()
        for row in hello:
            output += str(row.id) + ' - ' + row.data + '\n'
        return output

from the TG2 app into the more pythonic

        output = []
        hello = Hello.query.all()
        for row in hello:
            output.append('%s - %s' % (row.id, row.data))
        return '\n'.join(output)

which should be also slightly faster for big datasets.

(Also, the 'hello = Hello.query.all()' line uses the session-aware SA
mapper emulation, which is available since 1.1rc1.)


Chris

--~--~---------~--~----~------------~-------~--~----~
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