Re: TemplateResponse and json

2012-09-17 Thread Sebastian Henschel

heya...

On 09/17/2012 01:18 PM, David wrote:


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?


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

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



TemplateResponse and json

2012-09-17 Thread David
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

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/QI2KQakKmoQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.