code: def toggle_sensor(request, sensorname):
      
      if service.read_only:
          service.logger.warning("Could not perform operation: read only mode enabled")
          raise Http404
      source = request.GET.get('source', 'main')
      sensor = service.system.namespace[sensorname]
      sensor.status = not sensor.status
      service.system.flush()
      return HttpResponseRedirect(reverse(source))
docs: This is used only if websocket fails