Почему изменение моего запроса рендеринга в views.py нарушает мою способность импортировать изображения в моем base.html?
В моем файле views.py у меня есть функция для моей домашней страницы;
@login_required(login_url="/login")
def home(request):
user_object = User.objects.get(username=request.user.username)
user_profile = Profile.objects.get(user=user_object)
posts = Post.objects.all()
return render(request, "main/home.html", {'user_profile': user_profile}) #This is the problem line
и мой HTML работает отлично;
<body>
<header>
<div class="container">
<img src="{% static 'css/images/uReflect.png' %}" alt="logo" class="logo">
<nav>
Но когда я изменяю функцию home в файле views.py на код ниже, моя страница перестает работать. Я понятия не имею, как ошибка с 'post.image' может быть связана с доступом к моим изображениям, которые не зависят от постов и существуют в отдельной папке. Самым странным для меня является то, что ошибка говорит "NoReverseMatch at /home", но ошибка возникает даже не в home.html, а в base.html. Хотя, home.html расширяет base.html;
@login_required(login_url="/login")
def home(request):
user_object = User.objects.get(username=request.user.username)
user_profile = Profile.objects.get(user=user_object)
posts = Post.objects.all()
return render(request, "main/home.html", {'user_profile': user_profile, 'posts': posts}) # Change made here with posts