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
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
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!')