{% load static humanize event_custom_tags %}
Three six nine, the goose drank wine
{% endcomment %}Colored Text
{% endfor %}Cycle tag used to format a table:
{{ i }} |
Resetcycle tag:
{{ i }} |
This text will be converted to uppercase and have the HTML tags removed.
{% endfilter %}{% firstof None False '' empty_list 'This one!' 'Not this one' %}
List Colors:
The for loop variables:
Item | forloop.counter | forloop.counter0 | forloop.revcounter | forloop.revcounter0 | forloop.first | forloop.last |
---|---|---|---|---|---|---|
{{ item }} | {{ forloop.counter }} | {{ forloop.counter0 }} | {{ forloop.revcounter }} | {{ forloop.revcounter0 }} | {{ forloop.first }} | {{ forloop.last }} |
For...empty Tag
This list has items to show:
But this one doesn't:
This one will output a number of words:
{% lorem 5 w %}This one outputs a number of HTML paragraphs:
{% lorem 2 p %}This one outputs plain text paragraphs:
{% lorem 1 b %}And finally, we can output a number of random words:
{% lorem 10 w random %}or random paragraphs:
{% lorem 3 p random %}Best Bands:
|{{ "Left Justified"|ljust:"30" }}|
|{{ "Centered"|center:"30" }}|
|{{ "Right Justified"|rjust:"30" }}|
{{ 44040192|filesizeformat }}
{{ anothervar|get_digit:1 }}
{{ color_list|join:" and " }}
JSON can be output using the json_script
filter:
(You will need to look in the page source to see this one)
{{ best_bands|json_script:"best-bands" }} {{ venues|json_script:"all-venues" }}(This list will change every time you refresh the browser)
{{ color_list|random }}HTML aware version:
{{ "The Title"|truncatewords_html:1 }}{{ "The djangobook.com website is awesome!"|urlize }}
{{ "Now I lay me down to sleep"|wordwrap:4 }}