Using tojson filter instead of json.dumps