[Django]-Django-import-export outside admin

3👍

You should use the Format.create_dataset() method:

from import_export.formats.base_formats import XLS

def your_view():
    filehandle = form.cleaned_data['file']
    data = bytes()
        for chunk in import_file.chunks():
            data += chunk
    dataset = XLS().create_dataset(data)
    result = ExportSpec().import_data(...)

Leave a comment