Configuring Turbogears to use Mako

1 view
Skip to first unread message

casibbald

unread,
Jun 9, 2008, 11:23:16 AM6/9/08
to TurboGears, mark.mch...@gmail.com
Hi Mark,

Please may you be kind enough to detail how one would setup turbogears
to use mako.

Thank you so much for the assistance.

Regards

charles

casibbald

unread,
Jun 22, 2008, 8:01:47 AM6/22/08
to TurboGears
Instructions for working with Mako on Turbogears.

Step 1:

Edit <project>myfirstproject/config/app.cfg
add:

mako.directories = ["."]

Step 2:

Edit controller.py
add:

@expose('mako:myfirstproject.templates.private')
# Template will be located in <project>/templates/
# name as follows: pagename.mak
# within templates refer to static content with:
../static/css/stylesheet.css
def private(self):
return dict(a='foo')

Step 3:

Create: <project>/templates/private.mak
insert "hello world" and start Turbogears

Step 4:

Test your mako template at the following url

http://<servername>:8080/private

You should get your "hello world" message in your browser window.

Again thanks mark for helping me get this working.

regards

Charles
Reply all
Reply to author
Forward
0 new messages