Мое приложение django не отображается, вместо этого оно просто показывает идентификатор токена промежуточного ПО csrf в адресной строке

Это раздел файла views.py,

class filterTask(View):

    def get(self, request):
        return render(request, 'filter-task.html');

    def output(request):
        
        form = Taskform
        if request.method == 'GET':
            form = Taskform(request.GET.get('priorityChoice'))
            ans = Task.objects.filter(priority = form).values()
             

        return redirect(request, 'output.html',context={'ans':ans})


Это файл filter-task.html

{% include 'base.html' %}

`<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<a href="{% url 'index' %}">Go To Homepage</a>
<body>
    <h3>Filter Task by Priority</h3>
    <form method="get" autocomplete="off">
        {% csrf_token %}
        <label id="priorityChoice">Enter the priority </label>:
        <select id="priorityChoice" name="priorityChoice" required>
            <option value="low">low</option>
           <option value="mid">mid</option>
           <option value="high">high</option><br>
           
           </select><br><br>
        <input type="submit" value="Submit"/>


    </form>
    
    

</body>
</html>`

Я пытаюсь отфильтровать определенный атрибут объекта из html-файла, получая ответ из выпадающего списка, пожалуйста, помогите мне.

Я пытаюсь отфильтровать определенный атрибут объекта из html-файла, получая ответ из выпадающего списка, пожалуйста, помогите мне.

Вернуться на верх