title: Unable to loop form fields in django
body: <p>In models.py,I created a character type field called "category".After the user enters the category name,it is saved in the database and now I want to display all the category names stored in the database.I created four category names.I can see all four in the database but when displaying it in the UI, I see NONE instead of the category names.<br>
  views.py,</p>
  
  <pre><code>def add_cat(request):
      form = CatForm(request.POST or None)
      context = {"form":form}
  
      if form.is_valid():
          instance = form.save(commit=False)
          category = form.cleaned_data.get("category")
          instance.category = category
          instance.save()
          messages.add_message(request, messages.INFO, 'Category Added')
      return render(request,"add-cat.html",context)
  </code></pre>
  
  <p>forms.py,</p>
  
  <pre><code>class CatForm(forms.ModelForm):
      class Meta:
          model = Add_cat
          fields = ['category']
  </code></pre>
  
  <p>My template file,</p>
  
  <pre><code>{% extends "admin-menu.html" %}
  {% block content %}
  {% load staticfiles %}
  &lt;head&gt;
   &lt;link rel="stylesheet" href="{% static 'style.css' %}"&gt;
  &lt;/head&gt;
  &lt;h2 style="text-align: center;"&gt;Add Category&lt;/h2&gt;
      &lt;form method="POST"&gt;
          {% csrf_token %}
          &lt;table align="center"&gt;
              {{form.as_table}}
          &lt;/table&gt;
          &lt;input type="submit" value="Add" style="margin-left: 48%;"/&gt;
          &lt;input type="reset" value="Cancel"/&gt;    
      &lt;/form&gt;
  
      {% if messages %}
      &lt;ul class="messages" style="list-style-type: none;"&gt;
          {% for message in messages %}
          &lt;li{% if message.tags %} class="{{ message.tags }}"{% endif %}&gt;{{ message }}&lt;/li&gt;
          {% endfor %}
      &lt;/ul&gt;
      {% endif %}
  
      &amp;nbsp
      &lt;form id="id1"&gt;
      {% for field in form %}
          &lt;table align="center"&gt;
              &lt;tr&gt;&lt;th&gt;Category Name&lt;/th&gt;&lt;/tr&gt;   
              &lt;tr&gt;&lt;td&gt;{{field.value}}&lt;/td&gt;&lt;/tr&gt;
          &lt;/table&gt;
      {% endfor %}
      &lt;/form&gt;
  {% endblock %}
  </code></pre>