<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete_event_view(request, id):
 """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 """

    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})