title: Django how to DRY code from view
body: <p>I'm just starting coding in Django and I have code that repeat itself on a lot of pages.</p>
  
  <p>for example:</p>
  
  <pre><code>&lt;select name="seasons" id="season-id"&gt;
      {% for season in seasons %}
          {% if season_id|add:0 == season.id %}
              &lt;option value="{{ season.id }}" selected="selected"&gt;{{ season.name }}&lt;/option&gt;
          {% else %}
              &lt;option value="{{ season.id }}"&gt;{{ season.name }}&lt;/option&gt;
          {% endif %}
      {% endfor %}
  &lt;/select&gt;
  </code></pre>
  
  <p>In previous language I could use view helpers to make it more DRY.  How can I accomplish this in Django.</p>