@login_required(login_url='/accounts/login/')
def view(request, post_id):
    title = 'Upload New Post'
    current_profile = Profile.objects.filter(user_name=request.user.username).first()
    found_image = Image.objects.filter(id=post_id).first()
    image_comments = Comment.objects.filter(image_id=found_image.id).all()
    return render(request, 'view.html', {'title': title, 'post': found_image, 'profile': current_profile, 'comments': image_comments})
@login_required(login_url='/accounts/login/')
def view(request, post_id):
    title = 'Upload New Post'
    current_profile = Profile.objects.filter(user_name=request.user.username).first()
    found_image = Image.objects.filter(id=post_id).first()
    image_comments = Comment.objects.filter(image_id=found_image.id).all()
    return render(request, 'view.html', {'title': title, 'post': found_image, 'profile': current_profile, 'comments': image_comments})