I have provided a simple login functionality. For logout, I tried to use the built-in one. This is my urls.py:
(r\'\', include(\'django.contrib.auth.urls\'))
This is all fairly well explained in the manual, is there anything specific you don't understand?
https://docs.djangoproject.com/en/dev/topics/auth/default/#how-to-log-a-user-out
from django.contrib.auth import logout
def logout_view(request):
logout(request)
# Redirect to a success page.
Alternatively if you don't want to create your own view
https://docs.djangoproject.com/en/dev/topics/auth/default/#django.contrib.auth.views.logout
{% url 'logout' next='/some/url/' %}