Paginator in python django crashes on dict <p>I have 2 types of gathered data from database:</p> <p>One is <code>[&lt;NaseljenoMesto: NaseljenoMesto object&gt;, &lt;NaseljenoMesto: NaseljenoMesto object&gt;]</code></p> <p>And another is: <code>[{'naseljenomesto_drzava__naziv': u'Srbija', 'sifraMesta': u'ZR', 'nazivMesta': u'Zrenjanin', 'id': 3}, {'naseljenomesto _drzava__naziv': u'Srbija', 'sifraMesta': u'BG', 'nazivMesta': u'Beograd', 'id': 1}]</code></p> <p>First is QuerySet type and another is ValuesQuerySet.</p> <p>Now i have Paginator: <code>paginator = Paginator(filteredData, rowsPerPage)</code></p> <p>In first case paginator works but in second crashes. How to correct this?</p> <h2>EDIT</h2> <pre><code>Internal Server Error: /TestProjekat/main/getFormData/ Traceback (most recent call last): File "C:\Python27\lib\site-packages\django\core\handlers\base.py", line 115, in get_response response = callback(request, *callback_args, **callback_kwargs) File "C:\Users\Milan\Desktop\DA_LI_RADI\Test projekat\st_forms\views.py", line 238, in getFormData serializedData = serializers.serialize("json", data) File "C:\Python27\lib\site-packages\django\core\serializers\__init__.py", line 99, in serialize s.serialize(queryset, **options) File "C:\Python27\lib\site-packages\django\core\serializers\base.py", line 46, in serialize concrete_model = obj._meta.concrete_model AttributeError: 'dict' object has no attribute '_meta' </code></pre> <h2>EDIT 2</h2> <pre><code>paginator = Paginator(filteredData, rowsPerPage) try: data = paginator.page(page) except PageNotAnInteger: data = paginator.page(1) except EmptyPage: data = paginator.page(paginator.num_pages) serializedData = serializers.serialize("json", data) </code></pre> <h2>NEW ERROR</h2> <pre><code>Traceback (most recent call last): File "C:\Python27\lib\site-packages\django\core\handlers\base.py", line 115, in get_response response = callback(request, *callback_args, **callback_kwargs) File "C:\Users\Milan\Desktop\DA_LI_RADI\Test projekat\st_forms\views.py", line 238, in getFormData serializedData = json.dumps({'data': data}) File "C:\Python27\lib\json\__init__.py", line 243, in dumps return _default_encoder.encode(obj) File "C:\Python27\lib\json\encoder.py", line 207, in encode chunks = self.iterencode(o, _one_shot=True) File "C:\Python27\lib\json\encoder.py", line 270, in iterencode return _iterencode(o, 0) File "C:\Python27\lib\json\encoder.py", line 184, in default raise TypeError(repr(o) + " is not JSON serializable") TypeError: &lt;Page 1 of 1&gt; is not JSON serializable </code></pre>