title: Django Forms Template design classes
body: <p>Django Forms framework is excellent and renders the entire form by just the following.</p>
  
  <pre><code>{{ form.as_p }}
  </code></pre>
  
  <p>For a registration form, it converts above into:</p>
  
  <pre><code>&lt;p&gt;&lt;label for="id_username"&gt;Username:&lt;/label&gt; &lt;input id="id_username" type="text" name="username" maxlength="30" /&gt; Required. 30 characters or fewer. Alphanumeric characters only (letters, digits and underscores).&lt;/p&gt;
  &lt;p&gt;&lt;label for="id_email"&gt;Email:&lt;/label&gt; &lt;input type="text" name="email" id="id_email" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;label for="id_firstname"&gt;Firstname:&lt;/label&gt; &lt;input type="text" name="firstname" id="id_firstname" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;label for="id_lastname"&gt;Lastname:&lt;/label&gt; &lt;input type="text" name="lastname" id="id_lastname" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;label for="id_password1"&gt;Password:&lt;/label&gt; &lt;input type="password" name="password1" id="id_password1" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;label for="id_password2"&gt;Password confirmation:&lt;/label&gt; &lt;input type="password" name="password2" id="id_password2" /&gt;&lt;/p&gt;
  </code></pre>
  
  <p>But for the sake of design I want to add classes to each element in the form, as follows:</p>
  
  <pre><code>&lt;p&gt;&lt;label for="id_email" class="field-title"&gt;Email:&lt;/label&gt; &lt;input type="text" name="email" id="id_email" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;label for="id_firstname" class="field-title"&gt;Firstname:&lt;/label&gt; &lt;input type="text" name="firstname" id="id_firstname" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;label for="id_lastname" class="field-title"&gt;Lastname:&lt;/label&gt; &lt;input type="text" name="lastname" id="id_lastname" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;label for="id_password1" class="field-title"&gt;Password:&lt;/label&gt; &lt;input type="password" name="password1" id="id_password1" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;label for="id_password2" class="field-title"&gt;Password confirmation:&lt;/label&gt; &lt;input type="password" name="password2" id="id_password2" /&gt;&lt;/p&gt;
  </code></pre>
  
  <p>What is the standard way of adding these classes to individual form elements. Is it necessary to expand the form in the template manually to add these classes (in which case, the change in the form should also make corresponding changes in the template); This is too laborious, particularly since you need to add if errors, display errors also for each of those fields.</p>
  
  <p>Or is it better to supply some classes from the form class or the views, which seems a little ugly.</p>
  
  <p>I dont know much css, it should be possible to have these classes defined for the specified tags within a given class of a form. If yes, this should be the best way to go about doing it.</p>
  
  <p>How do you add designer classes to form elements. What do you think is the best way to add them.</p>