I am wondering if render_to_response is really the proper function you
are looking for.

For instance, here is a simple view that returns json using
HttpResponse without need of a template:

import simplejson
from django.http import HttpResponse
def output_json(request):
    data = [
        dict(name='joe', weight=165),
        dict(name='roger', weight=130),
    ]
return HttpResponse(simplejson.dumps(data), mimetype="application/
json")


More docs on the HttpResponse is available here:
http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpResponse.__init__


Preston
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to