retrieve object from context in django
def index (request):
context={}
data= Data.objects.all()
filesdata =
context["info"] = data
if request.method == 'POST':
errorAndTime = addFile(request)
context["error"] = errorAndTime["error"]
context["time"] = errorAndTime["time"]
# error = errorAndTime["error"]
# time = errorAndTime["time"]
return render(request, "dataAnalysis/index.html", context=context)
#When you retrieve your data just call the name of the context u don't need
#to call it like this context.info or something like that
{% for data in info %}
<tr>
<td>{{ data.file_id }}</td>
<td>{{ data.name }}</td>
<td>{{ data.age }}</td>
<td>{{ data.email }}</td>
<td>{{ data.phone }}</td>
<td>{{ data.gender }}</td>
</tr>
{% endfor %}