Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
django-import-export-extensions
Advanced tools
django-import-export-extensions
extends the functionality of
django-import-export
adding the following features:
To install django-import-export-extensions
, run this command in your
terminal:
pip install django-import-export-extensions
Add import_export
and import_export_extensions
to INSTALLED_APPS
# settings.py
INSTALLED_APPS = (
...,
"import_export",
"import_export_extensions",
)
Run migrate
command to create ImportJob/ExportJob models and
collectstatic
to let Django collect package static files to use in the
admin.
python manage.py migrate
python manage.py collectstatic
Prepare resource for your model
# apps/books/resources.py
from import_export_extensions.resources import CeleryModelResource
from .. import models
class BookResource(CeleryModelResource):
class Meta:
model = models.Book
Use CeleryImportExportMixin
class and set resource_classes
in admin
model to import/export via Django Admin
# apps/books/admin.py
from django.contrib import admin
from import_export_extensions.admin import CeleryImportExportMixin
from .. import resources
@admin.register(models.Book)
class BookAdmin(CeleryImportExportMixin, admin.ModelAdmin):
resource_classes = [resources.BookResource]
Prepare view sets to import/export via API
# apps/books/api/views.py
from .. import resources
from import_export_extensions.api import views
class BookExportViewSet(views.ExportJobViewSet):
resource_class = resources.BookResource
class BookImportViewSet(views.ImportJobViewSet):
resource_class = resources.BookResource
Don't forget to configure Celery if you want to run import/export in background
FAQs
Extend functionality of `django-import-export`
We found that django-import-export-extensions demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.