Thursday, June 25, 2020

Re: Getting exception while importing data though Django Admin

This seems to be an error raised by a third-party library; you'd probably get a quicker / better response by contacting their devs.

On Thursday, 25 June 2020 00:25:18 UTC+2, Sasi Tiru wrote:
Exception:

\lib\site-packages\import_export\resources.py", line 581, in import_data
    raise ImproperlyConfigured
django.core.exceptions.ImproperlyConfigured




models.py


class Supplier(models.Model) :
supplier_id = models.IntegerField(primary_key=True)
supplier_name = models.CharField(null=False, max_length=500)

def __str__(self) :
return self.supplier_name


admin.py

from django.contrib import admin
from import_export.admin import ImportExportModelAdmin

from .models import *


# Register your models here.
# @admin.register(Supplier)
class SupplierAdmin(ImportExportModelAdmin) :
pass


resources.py

from import_export import resources

from .models import *


class SupplierResource(resources.ModelResource) :
class Meta :
model = Supplier
import_id_fields = ['supplier_id']

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/167ddea8-933e-4b11-a0a5-c3bcd961e4b3o%40googlegroups.com.

No comments:

Post a Comment