@login_required(login_url='/accounts/login/')
def view_profile(request, user_id):
    title = 'Upload New Post'
    current_profile = Profile.objects.filter(user_name=request.user.username).first()
    found_user = Profile.objects.filter(id=user_id).first()
    user_posts = Image.objects.filter(profile_id=found_user).all()
    return render(request, 'view_profile.html', {'title': title, 'profile': current_profile, 'user_profile': found_user, 'posts': user_posts})
@login_required(login_url='/accounts/login/')
def view_profile(request, user_id):
    title = 'Upload New Post'
    current_profile = Profile.objects.filter(user_name=request.user.username).first()
    found_user = Profile.objects.filter(id=user_id).first()
    user_posts = Image.objects.filter(profile_id=found_user).all()
    return render(request, 'view_profile.html', {'title': title, 'profile': current_profile, 'user_profile': found_user, 'posts': user_posts})