code: def task_view(task):
      
  
      def _applier(request, **options):
          kwargs = request.POST if request.method == 'POST' else request.GET
          # no multivalue
          kwargs = {k: v for k, v in items(kwargs)}
          if options:
              kwargs.update(options)
          result = task.apply_async(kwargs=kwargs)
          return JsonResponse({'ok': 'true', 'task_id': result.task_id})
  
      return _applier
docs: Decorator turning any task into a view that applies the task
      asynchronously. Keyword arguments (via URLconf, etc.) will
      supercede GET or POST parameters when there are conflicts.
  
      Returns a JSON dictionary containing the keys ``ok``, and
          ``task_id``.