title: Django: class based view logout user if not staff
body: <p>I'm new to Django and I'm trying to use the <code>PermissionRequiredMixin</code> to verify if the authenticated user is <code>staff</code> before access to page, if he isn't authenticated the view redirects the user to the login page, on this page is loaded a form from <code>django.contrib.auth.views.login</code>, ok. But if the user is authenticated and he isn't <code>staff</code>, he will not have any form on the login page when redirected. </p>
  
  <p>What should I do? Logout the user if he is not staff when he try to access the staff only page? If yes, how can I do that using the <code>CBV</code> with <code>TemplateView</code>?</p>
  
  <p><strong>View</strong></p>
  
  <pre class="lang-python prettyprint-override"><code>from django.contrib.auth.mixins import PermissionRequiredMixin
  # ...
  class AdminView(PermissionRequiredMixin, TemplateView):
      permission_required = 'is_staff'
      template_name = 'checkout/admin.html'
  </code></pre>
  
  <p><strong>login URL</strong></p>
  
  <pre class="lang-python prettyprint-override"><code>from django.contrib.auth.views import login
  # ...
  url(r'^entrar/$', login, {'template_name': 'accounts/login.html'}, name='login')
  </code></pre>