3

I modified my Google App Engine app to work with Mako. To do this, I followed this answer including the comments:

Mako templates with Google App Engine

However, once you get to loading templates from files, you run into a big problem. By default, Mako's Template from mako/template.py wants to create a temporary file to store your compiled template. As far as I can tell, GAE doesn't allow you to create a temp file though. Has anyone run into this and figured out a work-around?

Community
  • 1
  • 1
Milimetric
  • 13,411
  • 4
  • 44
  • 56
  • The awesome team that wrote the aha framework actually figured this out. The mako_patch function here makes Mako store temporary files in memcache instead of on the filesystem: http://code.google.com/p/aha-gae/source/browse/aha/controller/makocontroller.py – Milimetric Aug 18 '11 at 21:18

1 Answers1

2

The awesome team that wrote the aha framework actually figured this out. The mako_patch function here makes Mako store temporary files in memcache instead of on the filesystem: http://code.google.com/p/aha-gae/source/browse/aha/controller/makocontroller.py

EDIT: as @Nick Johnson points out, storing this in local memory would make just as much sense and not incur the cost of memcache.

Milimetric
  • 13,411
  • 4
  • 44
  • 56