I have an issue in django, after click in import button in django admin site. This is my code code in admin.py
from django.contrib import admin
from .models import Person
@admin.register(Person)
class PersonAdmin(ImportExportModelAdmin):
pass
in models.py
from django.db import models
from django.conf import settings
from import_export.admin import ImportMixin
class Person(models.Model):
name = models.CharField(max_length=30)
email = models.EmailField(blank=True)
birth_date = models.DateField()
location = models.CharField(max_length=100, blank=True)
Error Image
I just faced the same issue, and solved it after wasting 4 hours...
Check the version of tablib and django-import-export that you're using. Django-import-export 1.x only supports tablib version is up to 0.14.0.
You can install a specific version of tablib in pip using
pip install tablib==0.14.0
Alternatively, upgrade your django-import-export to a more recent version (2.x), where this incompatibility is fixed.
Very recently, tablib upgraded to 1.0.0, during which the format class has changed.
Now, each file type (e.g. xlsx) is a class within the module.
django-import-export still expects the file types to be written in the old way, causing the error you see: no attribute 'title'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With