title: Django Rest Framework: How to show serialized value in django template?
body: <p>I am trying to show the serialized data in the Django template. I am using Django Rest framework. Using Ajax I have just tried to show the serialized data in a textarea in the html template view. </p>
  
  <p>In view.py, at first, I tried to make a dictionary from a list. And then send it to the serializer.py to make it JSON data. After doing this I just send that serialized data. And from the template, I am using ajax to get this data and set this value in a textarea which is get by ID identifier.</p>
  
  <p>But it does not show the value in the textarea. In the textarea, it just prints "[object Object]". So, how do I show the serialized data in the textarea?</p>
  
  <p>Here is my view.py:</p>
  
  <pre><code>@csrf_exempt
  def result(request):
      text = request.POST['test']
      triples = getTriples(text)
  
      keys = ['sub','predi','obj']
      demo_data = dict(zip(keys,triples[0]))
      serializer = SentenceListSerializer(data=demo_data)
  
      if serializer.is_valid():
           serializer.save()
  return JsonResponse(serializer.data, safe=False)
  </code></pre>
  
  <p>Ajax code:</p>
  
  <pre><code>$.ajax({
        method: 'POST',
        dataType: 'json',
        async: true,
        data: {'test': info},
        success: function(response_data){
          $('#textareashow').val(response_data);
  
        }
      });
  </code></pre>