Simple File Caching

52 views
Skip to first unread message

Vincent Catalano

unread,
Sep 20, 2012, 6:25:39 PM9/20/12
to pylons-...@googlegroups.com
I want to implement my own template system to be used with Pystache. Currently, I have a function getTemplates() that is called on every request I need to get templates, it iterates through a folder on the operating system and gets all files with the .mustache extension. This function then returns a dictionary of each of each of the template contents. What would be the best way to do the following.

1.) Reload all templates for every request ONLY IN DEVELOPMENT MODE (just like the reload_templates = true setting in the .ini file)
2.) Cache templates when in use on Production (perhaps using Beaker caching and a function cache decorator?)

Any advice the Pyramid community has would be appreciated. You guys rock!

-Vincent

John Anderson

unread,
Sep 20, 2012, 7:30:05 PM9/20/12
to pylons-...@googlegroups.com
https://github.com/sontek/pyramid_mustache allows you to use pystache
with pyramid if you want.
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To post to this group, send email to pylons-...@googlegroups.com.
> To unsubscribe from this group, send email to
> pylons-discus...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.

Vincent Catalano

unread,
Sep 24, 2012, 12:57:43 PM9/24/12
to pylons-...@googlegroups.com

Do you have any examples for how to use this?

Reply all
Reply to author
Forward
0 new messages