[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]

Django,python

Posted by Next-k