Guest User

Untitled

a guest
Jan 18th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. {% mytemplatetag %}
  2. {% if random %}
  3. Some Text {% mytemplatetag %}
  4. {% else %}
  5. Some other Text
  6. {% endif %}
  7. {% mytemplatetag %}
  8.  
  9. @register.tag
  10. def mytemplatetag(parser, token):
  11. template_loader, position = parser.command_stack[0][-1]
  12. print template_loader.loadname, position
Add Comment
Please, Sign In to add comment