Views.py
def logoutUser(request):
logout(request)
return HttpResponseRedirect('login')
urls.py
path('login/',views.Login,name='login'),
path('logout/',views.logout,name='logout'),
Html
{% if user.is_authenticated %}
<li class="nav-item">
<a class="nav-link" href="{% url 'logout' %}">Logout</a> </li>
The view django.contrib.auth.logout didn't return an HttpResponse object. It returned None instead.
Exception Location: C:\Users\dheeraj\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\handlers\base.py in _get_response, line 124
I also tried it using render and change url format ,but unable to understand where i am doing mistake.