code: def delete_event_view(request, id):
      
      event = get_object_or_404(Event, id=id)
      if not request.user.has_admin_permission('events'):
          raise exceptions.PermissionDenied
  
      if request.method == "POST":
          try:
              event.delete()
              messages.success(request, "Successfully deleted event.")
          except Event.DoesNotExist:
              pass
  
          return redirect("events")
      else:
          return render(request, "events/delete.html", {"event": event})
docs: Delete event page. You may only delete an event if you were the creator or you are an
      administrator. Confirmation page if not POST.
  
      id: event id