title: Creating json array in django
body: <p>I am trying to make a json array in django but I am getting error -</p>
  
  <pre><code>In order to allow non-dict objects to be serialized set the safe parameter to False
  </code></pre>
  
  <p>and my views.py -</p>
  
  <pre><code>def wall_copy(request):
      if True:
          posts = user_post.objects.order_by('id')[:20].reverse()
          return JsonResponse(posts) 
  </code></pre>
  
  <p>Basically user_post is a model a posts is the object of top 20 saved data. I want to send a json array but I am unable to convert posts into a json array. I also tried serializers but it didnt helped.</p>
  
  <p>I am stuck help me please.</p>
  
  <p>Thanks in advance.</p>