title: Django display data from mysql to HTML table
body: <p>I have a problem when i use Django to display data from mysql to HTML table.
  VIEW:</p>
  
  <pre><code>@login_required(login_url='/login')
  def data_to_list(request):
    data_list = ES_device.objects.all()
    context = {'data_list': data_list}
    #return render(request, 'logfile/data_bi.html', context)
    return render_to_response('logfile/data_bi.html',locals())
  </code></pre>
  
  <p>MODEL:</p>
  
  <pre><code>class device(models.Model):
    device_name = models.CharField(max_length=200, verbose_name='aaa', default=None)
    device_type = models.CharField(max_length=200, verbose_name='bbb', default=None)
  </code></pre>
  
  <p>URL:</p>
  
  <pre><code>url(r'^data_bi', data_to_list)
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;th&gt;..&lt;/th&gt;
  ...
  for item in data_list
      &lt;tb&gt;item.device_name&lt;/tb&gt;
      &lt;tb&gt;item.device_type&lt;/tb&gt;
  end for
  ...
  </code></pre>
  
  <p>but the result just shows the table head, no 's results, why this happen?how to solve this?
  Thanks for your help!</p>