How do I expire a django template cache key on receiving a signal?

后端 未结 3 1850
一生所求
一生所求 2021-02-06 10:25

In my front page template I use the cache function like this:

{% cache 86400 my_posts %}
    {% get_latest_posts %}
{% endcache %}

When there i

3条回答
  •  猫巷女王i
    2021-02-06 11:09

    Note that the md5_constructor in the first line of Benjamin Wohlwend's example above is deprecated. Current (Nov. 2011) version is:

    args = hashlib.md5(u':'.join([urlquote(resolve_variable(var, context)) for var in self.vary_on]))
    

提交回复
热议问题