'How to cache django permissions?

I have implemented permission in django. But for example,

{% if perms.application %}
     <li>          
    </li>
{% endif %}

Django fetches the permission every time user makes a request, so which means am getting two extra queries:

How to cache these permission so that the whole session uses the same ? Is there any better solutions for this ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source