I just want to write a table in HTML in Django, where the data is not from Database. It seems django-tables2 is a good package that I can use in Django. However, my data is not from Database, so maybe it's not necessary to use Django model. Here comes my code of view.py and HTML page:
def device_manager_submit(request):
'''Switch manager page'''
ret = rest.send_device_tor(device_name) #data from rest API exist in the form of array of dictronary: [{}, {}, {}]
return HttpResponse(ret) #return data to HTML
I can use for loop in HTML to display this data but I'm not clearly about how to show them:
<tbody>
{% for item in xx %} //I'm not sure
<tr>
<td>111</td> //how to display?
</tr>
{% endfor %}
Does anyone has any example that I can follow to display the data from view.py in HTML page