title: Django: How do I add arbitrary html attributes to input fields on a form?
body: <p>I have an input field that is rendered with a template like so:</p>
  
  <pre><code>&lt;div class="field"&gt;
     {{ form.city }}
  &lt;/div&gt;
  </code></pre>
  
  <p>Which is rendered as:</p>
  
  <pre><code>&lt;div class="field"&gt;
      &lt;input id="id_city" type="text" name="city" maxlength="100" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Now suppose I want to add an <code>autocomplete="off"</code> attribute to the input element that is rendered, how would I do that?  Or <code>onclick="xyz()"</code> or <code>class="my-special-css-class"</code>?</p>