Re: using django templates to generate and replace a file

2012-03-01 Thread Paul Bunker
Thanks Kurtis, It seems so obvious now! :-) I can do ... t = Template(open('users.template').read()) c = Context([get the users from db]) open('users.cfg','w').write(t.render(c)) Thanks for your speedy response! It seems I couldn't see the wood for the trees -Paul On Feb 29, 8:24 pm, Kurtis Mu

Re: using django templates to generate and replace a file

2012-02-29 Thread Kurtis Mullins
Hey, I just thought I'd give you a quick reply. First, you can save the rendered output of a template using this: https://docs.djangoproject.com/en/1.3/ref/templates/api/#rendering-a-context Then, take that String and write over that 'users.cfg' file. For example, http://docs.python.org/tutoria

using django templates to generate and replace a file

2012-02-29 Thread Paul Bunker
Hi Django Users, I'd like to use the django template system to generate a file 'users.cfg' that gets read some dispatching software. Is it possible to get django to generate this file and replace the existing one? Thanks -Paul -- You received this message because you are subscribed to the Goog