views:

32

answers:

1

I want to use Mako templates with GAE instead of Django templates. I found this post http://blog.pansapiens.com/2008/06/24/mako-templates-in-google-app-engine-seems-to-work-for-me/

I downloaded Mako from this page by using easy_install http://www.makotemplates.org/download.html

But that gave me a "beaker" file

c:\python26\lib\site-packages\beaker-1.5.4-py2.6.egg

that I don't know what to do with.

Can someone help me so that I can get "Mako" file to put in my GAE directory as instructed in the blog.

I saw the reference to Mako/GAE here http://stackoverflow.com/questions/744828/google-app-engine-dynamically-created-templates

Thank you.

+2  A: 

I use Mako on App Engine. It works very well for me.

All I do is download mako directly, then place the mako module directory in my app root.

Robert Kluin
Thanks! I have the folder Mako-0.3.4. Is that the mako module? And what is the correct from-import language that I need to use in the script. Thanks again.
Zeynel
You want the `mako` folder that is inside the Mako-0.3.4 folder. Then you can use the command from the guide you found, `from mako.template import Template` and so on.
Robert Kluin
That gives an error: File "C:\Users\A\Desktop\hw2\mako\filters.py", line 11, in <module> import markupsafeImportError: No module named markupsafe
Zeynel
Sorry, forgot about that. Edit `filters.py`, change line 11 (`import markupsafe`) to `import cgi` then change line 25 (`return markupsafe.escape(string)`) to `return cgi.escape(string)`.
Robert Kluin