1

I have this function in views.py:

def logout(request):
    logout(request) 
    return HttpResponse('Logged out succesfully!')

and this is the error I get when going to /logout

RecursionError at /logout/
maximum recursion depth exceeded
Proton
  • 31
  • 4

1 Answers1

3

Your view named logout(...) is conflicting with the Django's built-in logout function logout(...). So, change your view name to something other than logout,

from django.contrib.auth import logout


def my_logout_view(request):
    logout(request)
    return HttpResponse('Logged out succesfully!')
JPG
  • 82,442
  • 19
  • 127
  • 206