code: def delete(request):
      
      notification_id = request.POST.get('id', None)
      success = True
  
      if notification_id:
          try:
              notification = Notification.objects.get(pk=notification_id,
                                                      recipient=request.user)
              soft_delete = getattr(settings, 'NOTIFY_SOFT_DELETE', True)
              if soft_delete:
                  notification.deleted = True
                  notification.save()
              else:
                  notification.delete()
              msg = _("Deleted notification successfully")
          except Notification.DoesNotExist:
              success = False
              msg = _("Notification does not exists.")
      else:
          success = False
          msg = _("Invalid Notification ID")
  
      ctx = {'msg': msg, 'success': success, }
  
      return notification_redirect(request, ctx)
docs: Deletes notification of supplied notification ID.
  
      Depending on project settings, if ``NOTIFICATIONS_SOFT_DELETE``
      is set to ``False``, the notifications will be deleted from DB.
      If not, a soft delete will be performed.
  
      By default, notifications are deleted softly.
  
      :param request: HTTP request context.
  
      :return: Response to delete action on supplied notification ID.