TemplateResponse and json

56 views
Skip to first unread message

David

unread,
Sep 17, 2012, 7:18:22 AM9/17/12
to django...@googlegroups.com
Hello

I am aware of the options to set the content_type when using TemplateResponse, but is it possible to make the response itself return json converted rendered template and not just a rendered template?

Thank you

Sebastian Henschel

unread,
Sep 17, 2012, 8:36:15 AM9/17/12
to django...@googlegroups.com
heya...
maybe this will work for you:

import json
return json.dumps(rendered_template)


cheers,
Sebastian

--
Sebastian Henschel, Python Developer Web
txtr GmbH | Rosenthaler Str. 13 | 10119 Berlin | Germany

Reply all
Reply to author
Forward
0 new messages