def remove(request, video_id):
    """
    Removes the video from youtube and from db
    Requires POST
    """

    # prepare redirection url
    try:
        next_url = settings.YOUTUBE_DELETE_REDIRECT_URL
    except AttributeError:
        next_url = reverse("django_youtube.views.upload")

    # Remove from db
    try:
        Video.objects.get(video_id=video_id).delete()
    except:
        from django.contrib import messages
        messages.add_message(
            request, messages.ERROR, _('Video could not be deleted.'))

    # Return to upload page or specified page
    return HttpResponseRedirect(next_url)
def remove(request, video_id):
    

    
    try:
        next_url = settings.YOUTUBE_DELETE_REDIRECT_URL
    except AttributeError:
        next_url = reverse("django_youtube.views.upload")

    
    try:
        Video.objects.get(video_id=video_id).delete()
    except:
        from django.contrib import messages
        messages.add_message(
            request, messages.ERROR, _('Video could not be deleted.'))

    
    return HttpResponseRedirect(next_url)
def remove ( request , video_id ) : # prepare redirection url try : next_url = settings . YOUTUBE_DELETE_REDIRECT_URL except AttributeError : next_url = reverse ( "django_youtube.views.upload" ) # Remove from db try : Video . objects . get ( video_id = video_id ) . delete ( ) except : from django . contrib import messages messages . add_message ( request , messages . ERROR , _ ( 'Video could not be deleted.' ) ) # Return to upload page or specified page return HttpResponseRedirect ( next_url )
Removes the video from youtube and from db
    Requires POST
Removes the video from youtube and from db Requires POST