title: Django - How to serialize (and later iterate through) list of dictionaries?
body: <p>I am having hard time with serializing data from API since this is the first time that I am doing this. I would like to ask you for your help.</p>
  <p>From API i receive dictionary with some keys. Value for key &quot;Search&quot; is list of dictionaries that I would like to print in a for loop in my template later. But I failed.</p>
  <p>Here are my results that I managed to put together from few hours of googling and browsing through stack overflow.</p>
  <p>Here is my views.py:</p>
  <pre><code>def results(request):
      title = request.POST.get(&quot;Title&quot;)
      api_key = &quot;111111&quot;
      url = f&quot;http://www.omdbapi.com/?s={title}&amp;type=movie&amp;apikey={api_key}&quot;
      response = requests.get(url)
      serializer = SearchListSerializer(data=response.json()[&quot;Search&quot;], many=True)
  
      if serializer.is_valid():
          serializer.save()
          movies = serializer.objects.all()
      else:
          print(serializer.errors)
          print(&quot;Something went wrong.&quot;)
      return render(request, 'movie_database/results.html', movies)
  </code></pre>
  <p>And here is my serializers.py:</p>
  <pre><code>class MovieSerializer(serializers.ModelSerializer):
  
      class Meta:
          model = Movie
          fields = '__all__'
  
  
  class SearchSerializer(serializers.DictField):
  
      Title = serializers.CharField(max_length=300)
      Year = serializers.CharField(max_length=100)
  
  
  class SearchListSerializer(serializers.ListField):
  
      child = SearchSerializer()
  </code></pre>
  <p>I currently receive error:</p>
  <pre><code>TypeError at /results/
  __init__() got an unexpected keyword argument 'data'
  </code></pre>
  <p>But I know that it is only a tip of the iceberg. And one of the problems.</p>