[Django]-Maximum recursion depth exceeded on logout(request)

12👍

Kindly change name of your logout view.

The error is with:

def logout(request):
    print('logged out')
    logout(request)

    return redirect('index')

your view name is logout with request parameter. so when you call logout(request) in the view, it calls your logout view not Django’s logout function. that’s causing recursion.

Leave a comment