for p in db.collection.find({\"test_set\":\"abc\"}):
posts.append(p)
thejson = json.dumps({\'results\':posts})
return HttpResponse(thejson, mimetype=\"application/j
The json module won't work due to things like the ObjectID.
Luckily PyMongo provides json_util which ...
... allow[s] for specialized encoding and decoding of BSON documents into Mongo Extended JSON's Strict mode. This lets you encode / decode BSON documents to JSON even when they use special BSON types.