🎇
【手順書】django-import-export
必要なパッケージ
pip install django-import-export
settings.pyの設定
# settings.py
INSTALLED_APPS = [
....
'import_export',
....
]
admin.pyの設定
from django.contrib import admin
from import_export import resources
from import_export.admin import ImportExportModelAdmin
from import_export.fields import Field
from .models import Employee
class EmployeeResource(resources.ModelResource):
id = Field(attribute='id', column_name='id')
name = Field(attribute='name', column_name='name')
class Meta:
model = Employee
skip_unchanged = True
use_bulk = True
Discussion