Custom template conditon in Django

In my Django project I want to hide menu option under a custom built condition. In my base.html I want a construction like this:

{% if my_condition %}
   <a class="dropdown-item" href="...">New article</a>
{% endif %}

How to write 'my_condition'? I searched for 'custom template condition', but they all the answers direct me to the 'custom template tags and filters' of the Django documentation, but I can't find a satisfying solution.

Back to Top