DEV Community

Discussion on: SOLVED: django raises MultiValueDictKeyError at / 'file'

Collapse
 
highcenburg profile image
Vicente G. Reyes

I'll try this. I'm on another project so I'll let you know in a few hours if it worked or not. Thanks Mahendra!

Collapse
 
mahendrachoudhary profile image
Mahendra Choudhary • Edited

yup , let me knoe if it work. if not let me know how you solved it ..-

Thread Thread
 
highcenburg profile image
Vicente G. Reyes • Edited

I added


if request.method == 'GET':
return render(request, template)

and it was able to load the page

Thanks!

Thread Thread
 
mahendrachoudhary profile image
Mahendra Choudhary

ok , but does csv file uploaded? In your form you sending POST request , then why if request.method == 'GET' returning true????

Thread Thread
 
highcenburg profile image
Vicente G. Reyes

Yes, it went inside the admin through the models.py

Thread Thread
 
highcenburg profile image
Vicente G. Reyes

the next problem is to iterate the tables from the csv file

Thread Thread
 
divyam55 profile image
Divyam55

Hey! I'm having the same exact problem,
Can you share how you solved it?
Also how you iterate the tables from the csv file