<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def render_widget(self, request, widget_id):
        '''Returns rendered widget in JSON response'''

        widget = get_widget_from_id(widget_id)

        response = widget.render(**{'request': request})

        return JsonResponse({'result': response, 'id': widget_id})