title: Django - show error (ValidationError) inside the texfield of the form
body: <p>How do I set the error value into the textfield, right now it only show the error above the fields, I would like to show that in my textfield</p>
  
  <p><strong>Actual display:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/k6fkA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k6fkA.png" alt="What it show now"></a></p>
  
  <p><strong>My Goal:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/8Fpjd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8Fpjd.png" alt="What I want"></a></p>
  
  <p><strong>forms.py</strong></p>
  
  <pre><code>from django import forms            
  from django.contrib.auth.models import User   
  #from models import StudentRegistration
  from django.forms import ModelForm
  from promSpace.models import Space
  from StudentUsers.models import StudentRegistration
  from django.contrib.auth.forms import UserCreationForm  
  
  
  
  class MyRegistrationForm(forms.ModelForm):
      password = forms.CharField(widget=forms.PasswordInput)
      password2 = forms.CharField(widget=forms.PasswordInput)
      prom_code = forms.CharField(max_length = 8)
      email = forms.EmailField(max_length=50)
  
  
      def clean_email(self):
          email = self.cleaned_data['email']
          if StudentRegistration.objects.filter(email = email).exists():
              raise forms.ValidationError("Email already exists")
          return email
  
  
      def clean_password2(self):
          password = self.cleaned_data.get('password')
          password2 = self.cleaned_data.get('password2')
          if password and password2:
              if password != password2:
                  raise forms.ValidationError(("The two password fields didn't match."))
              elif password == '' or password2 == '':
                  raise forms.ValidationError(("The password cannot be blank"))
          return password2
  
  
      def clean_prom_code(self):
          prom_code = self.cleaned_data['prom_code']
          prom_code_ver = Space.objects.filter(prom_code = prom_code)
          if prom_code_ver.exists():
              return prom_code
              StudentRegistration.prom_name = prom_code_ver.prom_name
          else:
              raise forms.ValidationError(("The Prom Code Does not exist"))
  
  
      class Meta:
         model = StudentRegistration
         fields = ('email', 'first_name', 'last_name','gender','prom_code','password')
  </code></pre>
  
  <p><strong>register.html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  
      &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;/head&gt;
  
  
  &lt;body&gt;
  
      &lt;h1&gt;Register&lt;/h1&gt;
      &lt;form action="/register/" method="post"&gt;
  
      {% csrf_token %}
      &lt;div&gt;{{form.as_p}}&lt;/div&gt;
  
      &lt;input type="submit" value="Register" /&gt;
  
      &lt;/form&gt;
  
      &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>I really don't know how to begin, I've been looking inside the django docs and the only thing I could find was {{ form.field.value|default_if_none:"" }}</p>