Django loop all existing record to save but only one record save

enter image description here

this is my code in html

<td colspan="2" style="text-align: center;"><h2 style="font-weight: bold;">Required Documents:</h2></td>
</tr>{% for d in doc %}

<td style="text-align: left;">
<input type="file" name="myfile-{{}}" value="{{}}" style="outline: none;" required/>{{}}{{d.Description}}</td>
{% endfor %}

what I tried in my

myfile = request.FILES['myfile-6']
fs = FileSystemStorage()
filename =, myfile)
uploaded_file_url = fs.url(filename)
insert_doc = StudentsSubmittedDocument(
        Students_Enrollment_Records =  V_insert_data,
        Document = myfile

I don’t have idea on how to loop this myfile = request.FILES[‘myfile-6’]
with the existing id of Table Documents. please help me guys, im stuck on this problem 3days