Closed good-idea closed 7 years ago
Specifically, I'm trying to supply a dynamic argument to Django's template fragment caching templatetag:
{% load cache %} {% cache 500 sidebar request.user.username %} .. sidebar for logged in user .. {% endcache %}
I've tried all of the methods of interpolation here, but it always ends up taking the whole thing literally. For example:
- cache sidebar {{request.user.username}} // u('template.cache.{{request.user.username}}.d41d7c.... - cache sidebar #{request.user.username} // u('template.cache.#{request.user.username}.d41d7c....
Is it possible to include variables here? Is this a simple Jade thing that I'm missing, an issue with Django, or pyjade?
Closing this, nevermind -- - cache sidebar request.user.username works as expected: you just don't see the username in the cache tab of the Django toolbar.
- cache sidebar request.user.username
Specifically, I'm trying to supply a dynamic argument to Django's template fragment caching templatetag:
I've tried all of the methods of interpolation here, but it always ends up taking the whole thing literally. For example:
Is it possible to include variables here? Is this a simple Jade thing that I'm missing, an issue with Django, or pyjade?