title: Extracting data from the database table and display in view
body: <p>I want to fetch the data from a table which is in database and then display it in tabular format in my webpage. Only the html column name is being shown but not the data from the database table. Can anyone please help me out with this?</p>
  <p>My codes:
  views.py:</p>
  <pre><code>def display_majorheads(request):
  outputs = ProcessedOutputs.objects.all()
  be_year = 0
  context = {
          'processed_outputs':outputs, 
          'be_year':be_year,
      }
  return render(request, 'website/mhead.html', context )
  </code></pre>
  <p>mhead.html:</p>
  <pre><code>&lt;table class=&quot;table table-striped&quot;&gt;
                  &lt;tr&gt;
                      &lt;th&gt;MajorHead&lt;/th&gt;
                      &lt;th&gt;BeSalary&lt;/th&gt;
                      &lt;th&gt;BeGiaSalary&lt;/th&gt; 
                      &lt;th&gt;BeOther&lt;/th&gt; 
                      &lt;th&gt;BeTotal&lt;/th&gt; 
                      &lt;th&gt;BeNextyrSalary&lt;/th&gt;
                      &lt;th&gt;BeNextyrGiaSalary&lt;/th&gt;
                      &lt;th&gt;BeNextyrOthrs&lt;/th&gt;
                      &lt;th&gt;BeNextyrTotal&lt;/th&gt;
                  &lt;/tr&gt;
                  {% for processed_outputs in outputs %}
                  &lt;tr&gt; 
                      &lt;td&gt;{{ processed_outputs.major_cd }}&lt;/td&gt;
                      &lt;td&gt;{{ processed_outputs.be_salary }}&lt;/td&gt;
                      &lt;td&gt;{{ processed_outputs.be_gia_salary }}&lt;/td&gt;
                      &lt;td&gt;{{ processed_outputs.be_other }}&lt;/td&gt;
                      &lt;td&gt;{{ processed_outputs.be_total }}&lt;/td&gt;
                      &lt;td&gt;{{ processed_outputs.be_nextyr_salary }}&lt;/td&gt;
                      &lt;td&gt;{{ processed_outputs.be_nextyr_gia_salary }}&lt;/td&gt;
                      &lt;td&gt;{{ processed_outputs.be_nextyr_others }}&lt;/td&gt;
                      &lt;td&gt;{{ processed_outputs.be_nextyr_total }}&lt;/td&gt;  
                  &lt;/tr&gt;
                  {% endfor %}
              &lt;/table&gt;
  </code></pre>