title: How to use django login_required method
body: <pre><code>class HomePage(TemplateView):
  
      template_name = 'obs/homepage.html'
  </code></pre>
  
  <p>I want to make this view accessible to only logged in users. How can I do that? I've  seen django documentation but it was for functions. </p>