I am using django 1.4. I am moving codes from tornado to django. There is self.write()
at the end of a class
. What 's the alternative solution to self.write()
? HttpResponse? There is only one template page
so Do I need to response to other page? can I just call response? or render_to_response to the template page again to wrape data to the page? Is write()
same with HttpResponse()
?
Hey, guys. there are many "?" above, But I only have one problem. An alternative solution of tornado's "write()" in django.
thx for ur time.
The code in tornado looks like:
class DataHandler(tornado.web.RequestHandler):
...
val = ...
self.write(val)
Maybe in django?
def DataHandler(request):
...
val = ...
return HttpResponse(val)
Is that clear about my question?