标签:ble post rom global ret return pos select django
view.py
def search_post(request):
global ctx_2
cursor.execute(‘select * from testdj_test‘)
#ctx = {}
ctx_2 = dictfetchall(cursor)
return render(request, "post.html", {‘results‘: ctx_2})
html
<table class="table">
{% for item in results %}
<tr>
<td>{{item.name}}</td>
<td>{{item.age}}</td>
<td>{{item.course}}</td>
</tr>
{%endfor%}
</table>
标签:ble post rom global ret return pos select django
原文地址:https://www.cnblogs.com/tangbinghaochi/p/10755608.html