title: Random string in Django template
body: <p>Is there any way to have a random string in a Django template?</p>
  <p>I would like to have multiple strings displaying randomly like:</p>
  <pre><code>{% here generate random number rnd ?%}
  
  {% if rnd == 1 %}
    {% trans &quot;hello my name is john&quot; %}
  {% endif %}
  
  {% if rnd == 2 %}
    {% trans &quot;hello my name is bill&quot; %}
  {% endif %}
  </code></pre>
  <p>EDIT:<br />
  Thanks for answer but my case needed something more specific as it was in the base template (which I forgot to mention sorry ). So after crawling Google and some docs I fall on context processor article which did the job, I found it a little bit &quot;heavy&quot; anyway just for generating a random number...</p>
  <p>here is the blog page : <a href="http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/" rel="nofollow noreferrer">http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/</a></p>
  <p>Template tag did not the trick (or I did not find how) as it return a tag that cannot be translated as I remember (see blocktrans doc)</p>
  <p>I did not find a way to generate a number for the base view (is there any?) and if there is a way better than context process I'd be glad to have some info.</p>