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