 <p>you forgot to render the context</p> <p>you need: </p> <pre><code>def index(request): template_name = "index/index.html" is_teamleader = request.user.groups.filter(name='TL').exists() is_employee = request.user.groups.filter(name='Employee').exists() context = { 'is_teamleader': is_teamleader, 'is_employee': is_employee } return render(request, template_name, context) </code></pre>