title: how to restrict pages in Django? if "@login required(login_url='login')" does not work
body: <p>I'm working on this signup-login project in Django and i want to restrict home page.. but for some reason this code is not working for me.. can you tell me why? and is there any other way to restrict pages in Django?
  <em>@login_required(login_url='login')</em></p>
  <p><strong>views.py</strong></p>
  <pre><code>@login_required(login_url='login')
  def index(request):
     all_members = {}
     return render(request, &quot;HTML/index.html&quot;,{'Members': all_members})
  </code></pre>