Re: Thread-safeness of templates

2011-10-05 Thread Brian Bouterse
To add to your example. Default arguments are parsed once by the interpreter, not each time the program is run. Most folks don't desire side effects like this. One way to avoid it is to only use immutable typesin python as keyword arguments (True,

Re: Thread-safeness of templates

2011-10-04 Thread Martin J. Laubach
Are you sure your context is thread-safe, ie. it's rebuilt from scratch every time you render an email and not re-used, stored in a global variable, class variable, whatever? Your problem description very much sounds like someone is fiddling with the context while the template is rendering.

Thread-safeness of templates

2011-10-04 Thread Francis Kung
Hi, My understanding is that Django is (or attempts to be) thread-safe, and I'm hoping someone can help me track down this problem: Part of my app uses django templates to create the content of an email, which it then sends out. The code is something like, email = 'a...@def.com' context = {'em