Почему не выводится в template Django?

В общем нужно вывести k в user_profile. В task_list он успешно вывелся а в user_profile не отображается.В чем причина? Views

class TaskList(LoginRequiredMixin, ListView):
    model = Task
    context_object_name = 'tasks'

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)
        context['tasks'] = context['tasks'].filter(user=self.request.user)
        context['count'] = context['tasks'].filter(complete=False).count()
        context['k'] = context['tasks'].filter(complete=True).count()

        search_input = self.request.GET.get('search-area') or ''
        if search_input:
            context['tasks'] = context['tasks'].filter(title__icontains=search_input)
        context['search_input'] = search_input

        return context

user_profile.html

{% extends 'base/main.html' %}
{% load static %}
{% block content %}

    <div class="header-bar">
        <h1>Profile</h1>
        
        <a href="{% url 'tasks' %}">&#8592; Back</a>
        
    </div>
    
    <div class="card-body">
    {% if user.profile.profile_pic %}
      <img src="{{ profile.profile_pic.url }}" height=100 width=100><br><br>
    {% else %}
      <img src="{% static 'base\images\profile\user.png' %}" height=100 width=100><br><br>
    {% endif %}
      <p><strong>Username:</strong> {{ page_user }}</p><br><br>
      <p><strong>Bio:</strong> {{ profile.bio }}</p><br><br>
      <p><strong>Twitter:</strong> {{ profile.twitter }}</p><br><br>
      <p><strong>Instagram:</strong> {{ profile.instagram }}</p><br><br>
      <p><strong>Facebook:</strong> {{ profile.facebook }}</p><br><br>
      <p>{{k}}</p>
      {% if user.id == profile.user.id %}
      <a href="{% url 'edit_user_profile' profile.id %}"><button class="button">Edit</button></a>
      {% endif %}
      
    
    
    </div>

{% endblock content %}

task_list.html

{% extends 'base/main.html' %}

{% block content %}

    <div class="header-bar">
        <div>
            <script language="javascript" type="text/javascript">
                var d = new Date();
                var day=new Array("Sunday","Monday","Tuesday",
                "Wednesday","Thursday","Friday","Saturday");
                var month=new Array("January","February","March","April","May","June",
                "July","August","September","October","November","December");
                document.write(day[d.getDay()]+" " +d.getDate()+ " " + month[d.getMonth()]
                + " " + d.getFullYear());
            </script>
            <h1>Hello, <a href="{% url 'edit_profile' %}">{{request.user|title}}</a></h1>
            <h3 style="margin:0">You have <i style="color:yellow">{{count}}</i> incomplete and <i style="color:yellow">{{k}}</i> complete tasks</h3>
        </div>

        {% if request.user.is_authenticated %}
            <ul class="ddropdownn">
                <li class="ddropdownn-top">
                    <a class="ddropdownn-top" href="#">Menu</a>
                    <ul class="ddropdownn-inside">
                        <li><a href="{% url 'top-users' %}">Top</a></li>
                        <li><a href="{% url 'about' %}">About</a></li>
                        <li><a href="{% url 'edit_profile' %}">Settings</a></li>
                        {% if user.profile.id %}
                        <li><a href="{% url 'user_profile' user.profile.id %}">Profile</a></li>
                        {% else %}
                        <li><a href="{% url 'create_user_profile'  %}">Profile</a></li>
                        {% endif %}
                        <li><a href="{% url 'logout' %}">Logout</a></li>
                        <li><a href="https://forms.yandex.ru/cloud/6170f0b40208c60589a01c66/">Support</a></li>
                    </ul>
                </li>
            </ul>
        {% else %}
            <a href="{% url 'login' %}">Login</a>
        {% endif %}
    </div>

    <div id="search-add-wrapper">
        <form method="GET" style="margin-top: 20px;display: flex;">
            <input type='text' name='search-area' value="{{search_input}}">
            <input class="button" type="submit" value='Search'>
        </form>
        <a class="button btn-create" id="add-link" href="{% url 'task-create' %}">&#x2b;</a>
    </div>


    <div class="task-items-wrapper">
        {% for task in tasks %}
            <div class="task-wrapper" >
                {% if task.complete %}
                    <div class="task-title">
                        <div class="task-complete-icon"></div>
                        <i><s><a href="{% url 'task-update' task.id %}">{{task}} {{task.due_date}}</a></s></i>
                    </div>
                    <a class="delete-link" href="{% url 'task-delete' task.id %}">&#215;</a>
                {% else %}
                    <div class="task-title">
                        <div class="task-incomplete-icon"></div>
                        <a href="{% url 'task-update' task.id %}">{{task}}|{{task.due_date}}</a>
                    </div>
                    <a class="delete-link" href="{% url 'task-delete' task.id %}">&#215;</a>
                {% endif %}
            </div>
            {% empty %}
            <h3>No items in list</h3>
        {% endfor %}
    </div>

{% endblock content %}
Вернуться на верх