Adds a button "Import" on model list page in Django admin site that allow to import new records to any model.
I have got idea from django-import-export and adopted it to work with CVS file import.
Follow next steps:
- Install with
pip install django-data-import
- Add
django_data_import
toINSTALLED_APPS
in yoursettings.py
file - Edit your
admin.py
file and addfrom django_data_import import ImportDataMixin
and add mixin to ModelAdmin like thisclass BlogAdmin(ImportDataMixin, admin.ModelAdmin)