rand - random number operations

native_tags.contrib.rand.randchoice(*seq)

Choose a random element from a non-empty sequence.

Syntax:

{% randchoice [sequence] %}
{% randchoice [choice1 choice2 ...] %}
native_tags.contrib.rand.randint(a, b)

Return random integer in range [a, b], including both end points.

Syntax:

{% randint [a] [b] %}
native_tags.contrib.rand.random() → x in the interval [0, 1).

Syntax:

{% random %}
native_tags.contrib.rand.randrange(*args, **kwargs)

Choose a random item from range(start, stop[, step]).

This fixes the problem with randint() which includes the endpoint; in Python this is usually not what you want. Do not supply the ‘int’, ‘default’, and ‘maxwidth’ arguments.

Syntax:

{% randrange [stop] [options] %}
{% randrange [start] [stop] [step] [options] %}
Read the Docs v: latest
Versions
latest
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.