Problem requesting app from homepage

Hello everyone and sorry in advance for my broken English.
I created a django project with multiple apps all gathered on a central page/app called core
All my apps work except the Taskboard app: A small module like a notification badge which displays the tasks assigned to a staff and which, once completed, allows them to be validated via the button of the same name)
Preview :

My problem is that when I check one of the boxes and press the validate button… nothing happens.
Message on my django console : “POST /taskboard/validate_tasks/ HTTP/1.1” 302 0

Here is my code, I apologize in advance it really became a mess after looking for solutions everywhere :
App Taskboard :

from django.db import models
from django.contrib.auth.models import User

class Task(models.Model):
    # Relais avec l'objet User
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    # Nom de l'utilisateur qui a créé la tâche
    nom_personnel = models.CharField(max_length=255, blank=True, null=True, default='')
    creation_date = models.DateTimeField(auto_now_add=True)
    due_date = models.DateTimeField()
    statement = models.TextField()
    completed = models.BooleanField(default=False)

    def __str__(self):
        return f"Tâche pour {self.user.username}"

class ArchiveTask(models.Model):
    nom_personnel = models.CharField(max_length=255)
    date_creation = models.DateTimeField(auto_now_add=True)
    date_fin_demandee = models.DateTimeField()
    enonce = models.TextField()

    def __str__(self):
        return f"{self.nom_personnel} - {self.date_creation}"
# taskboard/
from django.shortcuts import render, redirect
from .models import Task, ArchiveTask
from django.contrib.auth.decorators import login_required
from core.views import homepage  # Mettez à jour l'import
from django.urls import reverse

def task_list(request):
    user_tasks = Task.objects.filter(user=request.user, completed=False)
    task_count = user_tasks.count()
    return {'user_tasks': user_tasks, 'task_count': task_count}

def validate_tasks(request):
    if request.method == 'POST':
        # Get the list of task IDs from the POST request
        task_ids = request.POST.getlist('task_ids')

        # Iterate through the task IDs and archive/delete the tasks
        for task_id in task_ids:
            task = Task.objects.get(pk=task_id)
            archive_task = ArchiveTask(

    # Get the URL corresponding to the homepage view
    homepage_url = reverse('core:homepage')

    # Redirect to the homepage
    return redirect(homepage_url)
# taskboard/
from django.urls import path
from .views import task_list, validate_tasks

app_name = 'taskboard'

urlpatterns = [
    path('task_list/', task_list, name='task_list'),
    path('validate_tasks/', validate_tasks, name='validate_tasks'),
<!-- taskboard/task_list.html -->

{% load static %}

<link rel="stylesheet" href="{% static 'css/taskboard.css' %}">
<div id='taskboardcss'>
    <!-- Ajout de l'icône avec un badge -->
    <a href="#" id="icon-link">
        <span id="task-badge">{{ task_count }}</span>
        <img id="icon-user" src="{% static 'image/utilisateur.png' %}" alt="Task Icon">

    <!-- Fenêtre déroulante -->
    <div id="dropdown-content">
            {% for task in user_tasks %}
                        <strong>Crée le:</strong> {{ task.creation_date }}
                        <strong>A faire le:</strong> {{ task.due_date }}
                        <strong>Tache :</strong> {{ task.statement }}
                        <strong>OK :</strong> <input type="checkbox" name="task_ids" value="{{ }}">
            {% endfor %}
            <form method="post" action="{% url 'taskboard:validate_tasks' %}">
                {% csrf_token %}
                <input type="submit" value="Valider">

    <!-- Bouton pour ouvrir la fenêtre déroulante -->
        document.addEventListener("DOMContentLoaded", function () {
            var iconLink = document.getElementById("icon-user");
            var dropdownContent = document.getElementById("dropdown-content");
            iconLink.addEventListener("click", function (event) {
                // Toggle display
       = ( === 'none' || === '') ? 'block' : 'none';
            window.addEventListener("click", function (event) {
                // Vérifier que l'élément cliqué n'est pas l'icône
                if ( !== iconLink && !== dropdownContent && !dropdownContent.contains( {
           = "none";

App Core :

# core/
from django.shortcuts import render, redirect
from menulateral.models import MenuItem
from menuvertical.models import MenuItemVertical
from alerte.models import Appli, Alerte
from alerte.forms import AlerteForm
from taskboard.models import Task, ArchiveTask
from filactu.views import ActivityListView
from django.contrib.auth.decorators import login_required

def homepage(request):
    vertical_menu_items = MenuItemVertical.objects.all()
    lateral_menu_items = MenuItem.objects.all()
    liste_alertes_items = Alerte.objects.all()
    liste_applications_items = Appli.objects.all()
    form = AlerteForm(request.POST)
    if request.method == 'POST':
        form = AlerteForm(request.POST)
        if form.is_valid():

    # Filtrer les tâches par utilisateur
    liste_task_items = Task.objects.filter(user=request.user)
    liste_taskarchive_items = ArchiveTask.objects.all()

    # Utilisez la méthode get_context_data pour obtenir le contexte
    activities_context = ActivityListView().get_context_data()

    return render(request, 'core/homepage.html', {
        'vertical_menu_items': vertical_menu_items,
        'lateral_menu_items': lateral_menu_items,
        'liste_alertes_items': liste_alertes_items,
        'liste_applications_items': liste_applications_items,
        'liste_task_items': liste_task_items,
        'liste_taskarchive_items': liste_taskarchive_items,
        'form': form,
        **activities_context  # Utilisez les données de contexte de l'app filactu
from django.urls import path
from . import views
from taskboard.views import validate_tasks

app_name = 'core'

urlpatterns = [
    path('', views.homepage, name='homepage'),
    path('taskboard/validate_tasks/', validate_tasks, name='taskboard_validate_tasks'),  # Utiliser l'espace de noms
<!DOCTYPE html>
<html lang="fr">
{% csrf_token %}
{% load static %}
    <meta charset="UTF-8">
    <link rel="favico icon" href="{% static 'image/logocentralisation.png' %}"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Centralis@tion 3.0</title>
    <link rel="stylesheet" href="{% static 'css/base.css' %}">

        {% include "menuvertical/menu_verticale.html" %}

        {% include "menulateral/menu_template.html" %}

    {% include "filactu/filactu.html" %}
    {% include "taskboard/task_list.html" with user_tasks=liste_task_items task_count=liste_task_items.count %}
    {% include "alerte/template_alerte.html" %}


project :

URL configuration for tuto project.

The `urlpatterns` list routes URLs to views. For more information please see:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    path('menulateral/', include('menulateral.urls')),
    path('menuvertical/', include('menuvertical.urls')),
    path('alerte/', include('alerte.urls')),
    path('filactu/', include('filactu.urls')),
    path('core/', include('core.urls')),
    path('taskboard/', include('taskboard.urls', namespace='taskboard')),
    path('', include('logger.urls')),

Thank you in advance for your help !

Your view probably does not receive any tasks ids, because in the taskboard/task_list.html template, the task_ids input is outside the form. Let’s try to move the <form>...</form> tags to englobe the <ul>...</ul>.

You can confirm that the view does or doesn’t receive task ids by printing task_ids after request.POST.getlist('task_ids')


Indeed I don’t receive any task_ids despite moving the form to the ul… I already have a better lead, thank you!

Oh my god I just can’t read sorry…
Indeed moving the UL in the form was the solution. Thank you so much !