def update(self, request, pk=None):
    if (pk.upper() in self.valid_keys):
        data = request.data
        setattr(config, pk.upper(), data['value'])
        return Response({pk: data['value']})
    else:
        raise Http404
def update(self, request, pk=None):
    if (pk.upper() in self.valid_keys):
        data = request.data
        setattr(config, pk.upper(), data['value'])
        return Response({pk: data['value']})
    else:
        raise Http404