Logout give me error in django --- maximum recursion depth exceeded [closed]

enter image description here

  • in views

    from django.contrib.auth import logout
    
    
    def logout(request):
        logout(request)
        return redirect('login/')
    
  • in url

    path('logout/', views.logout, name="logout"),
    
  • in html

    <a href="{% url 'logout' %}">logout</a>
    

error

RecursionError at /logout/

maximum recursion depth exceeded

RecursionError at /logout/

maximum recursion depth exceeded
Back to Top