

def render_json(content, request):
    'Take dict/list/string/number content and return json response.\n\n    This respects the :meth:`morepath.App.dump_json` directive that\n    can be used to serialize any object to JSON. By default this\n    serializes Python objects like dicts, strings to JSON.\n\n    :param content: content as returned from view function.\n    :param request: a :class:`morepath.Request` instance.\n    :return: a :class:`morepath.Response` instance with a serialized\n      JSON body.\n    '
    return Response(json.dumps(generic.dump_json(request, content, lookup=request.lookup)), content_type='application/json')

dataset/ETHPy150Open morepath/morepath/morepath/view.py render_json/original