title: How to save the users last logout time
body: <p>I am looking to save the users last logout time.My idea was to add it to the users profile model. I am using Django 1.11.15 </p>
  
  <p>Example:</p>
  
  <pre><code>class Profile(models.Model):
      user = models.OneToOneField(User, on_delete=models.CASCADE) 
      ...
      last_logout = models.DateTimeField(blank=True, null=True) 
  </code></pre>
  
  <p>below is how I created my profile model just for reference</p>
  
  <pre><code>def signup(request):
      if request.method == 'POST':
          form = UserCreateForm(request.POST or None)
          if form.is_valid():
              new_user = form.save()
              Profile.objects.create(user=new_user)
              return redirect('accounts:edit_profile')
      else:
          form = UserCreateForm()
      context = {'form': form}
      return render(request, 'accounts/signup.html', context)
  </code></pre>
  
  <p>Below is what I intend to do. Is this the correct way. I want to add to django's default signout/logout method I am not sure if its called <code>signout</code> or <code>logout</code></p>
  
  <pre><code>class LoggedOut(TemplateView):
      template_name = 'logged_out.html'
      def signout(self):
          """logout user """
          self.request.user.profile.last_logout = datetime.now()
          self.request.user.profile.save()
  </code></pre>
  
  <p>My URL's</p>
  
  <pre><code>url(r'^loggedout/$', views.LoggedOut.as_view(), name='loggedout'),
  </code></pre>