problem with filters

hello, I have a problem using my django application, I have two apps, two views and tamplates. I want to implement filters on the results of a query, but I am directly redirected to the logout page.
I share my files with you.

my first view

from django.shortcuts import render
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from .models import datalog
from .filtre import *
#from django.contrib.auth.decorators import login_required


#@login_required (login_url='login')
# Create your views here.
def HomeLog(request):
    current_user= request.user
    log = datalog.objects.all()
    monfiltre= logFilter(request.GET,queryset=log )
    log=monfiltre.qs
    paginator = Paginator(log, 10)  # Affichez 10 tickets par page

    # Récupérez le numéro de la page à partir de la requête, par défaut à la première page
    page = request.GET.get('page')

    try:
        log = paginator.page(page)
    except PageNotAnInteger:
        # Si la page n'est pas un entier, fournissez la première page
        log = paginator.page(1)
    except EmptyPage:
        # Si la page est hors limites (par exemple, 9999), fournissez la dernière page
        log = paginator.page(paginator.num_pages)
    context={'log':log,'current_user':current_user,'monfiltre':monfiltre}
    
    return render(request,'log/acceuil.html', context)
    

ma user view

from django.shortcuts import render,redirect
from django.contrib.auth import authenticate,login,logout
from django.contrib import messages

# Create your views here.

def login_user(request):
    
    if request.method == "POST":
        username = request.POST["username"]
        password = request.POST["password"]
        user = authenticate(request, username=username, password=password)
        
        if user is not None:
            login(request, user)
            return redirect('list')
    
        else:
            messages.error(request,("Profil ou mot de passe incorect"))
            return render(request, 'registration/login.html')
    
    else:
        return render(request, 'registration/login.html')
    

def logout_user(request):
    logout(request)
    messages.error(request,("Deconnexion réussi"))

    return redirect('login')

my tamplate

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

{% block content %}

<div class="container-fluid">
     <div class="row ">
        <div class="col-sm">
            <div class="card card-body">
              <form method="get">
                {{monfiltre.form}}
                <button class="btn btn-primary" btn-sm>
                  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-filter" viewBox="0 0 16 16">
                    <path d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5"/>
                  </svg>
                  FILTRER
                  </button>
              </form>
            </div>
        </div>
      <div>
    <table class="table">
      <div class="card- card-body">
        <thead>
          <tr>
            <th scope="col">Date</th>
            <th scope="col">Heure</th>
            <th scope="col">Utilisateur</th>
            <th scope="col">Opération</th>
            <th scope="col">Action</th>
            <th scope="col">Numéro de compte</th>
            <th scope="col">Montant</th>
          </tr>
        </thead>
        <tbody>
            {% for log in log %}
          <tr>
            <th>{{log.date_eve|date:"d/m/Y"}}</th>
            <td>{{log.heure}}</td>
            <td>{{log.utilisateur}}</td>
            <td>{{log.operation}}</td>
            <th>{{log.libelle}}</th>
            <td>{{log.compte}}</td>
            <td>{{log.montant}}</td>
          </tr>
          {% endfor %}
        </tbody>
      </table>

      <div class="container">
        <div class="row my-5">
            <div class="col-md-4 offset-md-5">
                <p> Page: {{ log.number }} /{{ log.paginator.num_pages }}</p>
                <nav aria-label="Page navigation example">
                    <ul class="pagination">
                        {% if log.has_previous %}
                      <li class="page-item"><a class="page-link" href="?page={{ log.previous_page_number }}">Previous</a></li>
                      {% endif %}
        {% if log.has_next %}
                      <li class="page-item"><a class="page-link" href="?page={{ log.next_page_number}}">Next</a></li>
                      {% endif %}
                    </ul>
                  </nav>
            </div>
        </div>
      </div>
    </div>



{% endblock %}

Side note: When posting file contents, please label the file with the actual directory and file name and not a generic label like “my template”. (Is “my template” actually ‘log/acceuil.html’? Or is it some other file?)

Please be more specific with what’s happening.

You log in, which happens in your login_user view?

If the login is successful, it redirects you to a url named ‘list’. Is that a reference to your HomeLog view?

When in this process are you redirected?

What errors (if any) show up in the console log where you’re running runserver?

If there aren’t any errors, what requests are being made?

Note: I see in your template you are creating your links for the paginator. However, you are not including any filters that you had originally supplied, which means that each page that you go to are going to show the unfiltered list.

Sorry, actually list refers to the HomeLog view.
and when connecting I am indeed directed to the list of logs retrieved from the database.

the inconsistency is in my log/acceuil.html, when I click on the filtered button I am redirected to ulr http://127.0.0.1:8000/ which is the login page.

I’m posting a screenshot of my acceuil.html interface

when I click on filter it is the logout function which is executed,

Please post the view that you are directed to by the redirect('list') function.

Thank you very much for your interest in my problem.

here is the view whose list is referred to

log/views.py

from django.shortcuts import render
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from .models import datalog
from .filtre import *
#from django.contrib.auth.decorators import login_required


#@login_required (login_url='login')
# Create your views here.
def HomeLog(request):
    current_user= request.user
    log = datalog.objects.all()
    monfiltre= logFilter(request.GET,queryset=log )
    log=monfiltre.qs
    paginator = Paginator(log, 10)  # Affichez 10 tickets par page

    # Récupérez le numéro de la page à partir de la requête, par défaut à la première page
    page = request.GET.get('page')

    try:
        log = paginator.page(page)
    except PageNotAnInteger:
        # Si la page n'est pas un entier, fournissez la première page
        log = paginator.page(1)
    except EmptyPage:
        # Si la page est hors limites (par exemple, 9999), fournissez la dernière page
        log = paginator.page(paginator.num_pages)
    context={'log':log,'current_user':current_user,'monfiltre':monfiltre}
    
    return render(request,'log/acceuil.html', context)
    

log/urls.py

from django.urls import path
from . import views

urlpatterns = [

    path('',views.HomeLog,name='list'),
   # path('export/excel/', views.export_to_excel, name='export_excel'),
 #   path('export/pdf/', views.export_to_pdf, name='export_pdf'),

    
]

What does your project-level urls.py file look like?

Hello, thank you again for your willingness to help me.,
project-level urls.py file l:

 from django.contrib import admin
from django.urls import path,include


Project/urls.py

urlpatterns = [
    path('admin/', admin.site.urls),
    path('logs',include('log.urls')),
    path('',include('utilisateur.urls')),

]

#configuaration de la page d'administraction

admin.site.site_header = "UGB | Log_Audit"
admin.site.site_title = "Log_Audit"
admin.site.index_title = "Log_Audit | Page d'administration"

The only thing I see so far is that you don’t have the trailing “/” at the end of your path definition for 'logs'. (It should probably be 'logs/') I don’t necessarily think that’s the problem here, but almost certainly you’ll want to correct that before proceeding further.

Please post the console log from where you’re running runserver, showing all the requests being made.