On Django-1.9.6, django-import-export-0.5
When I try to upload CSV without \"id\" field throws this error.
Line number: 1 - u\'id\'
13173474, Harry
The id field is an auto increment field, so if you're adding new records (I believe its the most case) the id field should be there in the header (first line of csv file) and the rest of the rows should contain empty id like : ,
Example:
CSV File:
id, username,email,password
,ahmad,ahmad@all.com,secretum
,salafi,salafi@gmail.com,Passhdjdj
In the Resource file (py):
class JasResult(ImportExportModelAdmin):
resource_class = JasResource
skip_unchanged = True
report_skipped = True
exclude = ('id',)
import_id_fields = ('username','email','password')
This should fine for most cases.