[Django]Processing CSV files sent by post request
def import_csv(request):
if request.method == 'POST' and request.FILES['myfile']:
myfile = request.FILES['myfile']
# Read csv file InMemoryUploadedFile
file = myfile.read().decode('utf-8-sig')
reader = csv.DictReader(io.StringIO(file))
data = [line for line in reader]
Discussion
New Comments
No comments yet. Be the first one!