From Classy Class Based Views LogoutView

Log out the user and display the 'You are logged out' message.


  • next_page: redirects the user on logout.
  • redirect_field_name: The name of a GET field containing the URL to redirect to after log out. Defaults to next. Overrides the next_page URL if the given GET parameter is passed. 1
  • template_name: defaults to registration\logged_out.html. Even if you don’t have a template the view does get rendered but it uses the default Django skin. You’ll want to create your own to allow the user to logout AND to keep the look and feel of the site.


class myLogoutView(LogoutView):

path('logout_view/', views.myLogoutView.as_view(), name='logout_view'),


{% extends "base.html" %}
{% load i18n %}

{% block content %}
<p>{% trans "Logged out" %}</p>
{% endblock %}


A visual representation of how LogoutView is derived can be seen here:

Image Link from CCBV YUML goes here


I’m not sure how it could be much easier to implement a logout page.

  1. Per Django Docs