Django - Jinja2 caching of template variables
<p>Before Jinja2 i was using a custom context_processor for caching (objects list ) via memcached. </p>

<pre><code>#context_processors.py    
def pikto_studio_caching(request:None, sender:None, **kwargs):
        cache_time = 60*60*24
        cache_key_works = 'pikto_studio:works'

        works = cache.get(cache_key_works)

        if request:
            if not works:
                works = Work.objects.all()
                cache.set(cache_key_works, works, cache_time)
            return {'WORKS':works}
        else:
            cache._cache.flush_all()
            return None
</code></pre>

<p>With jinja2 i can't use context_processors. How can i solve this?</p>

<p>Thanks.</p>