Extend functionality of `django-import-export`
Project description
Django-import-export-extensions
Links
Description
django-import-export-extensions extends the functionality of
django-import-export
adding the following features:
- Import/export resources in the background via Celery
- Manage import/export jobs via Django Admin
- DRF integration that allows to work with import/export jobs via API
- Support drf-spectacular generated API schema
- Additional fields and widgets (FileWidget, IntermediateManyToManyWidget, IntermediateManyToManyField)
Installation
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
Usage
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
License
- Free software: MIT license
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_import_export_extensions-1.9.2.tar.gz.
File metadata
- Download URL: django_import_export_extensions-1.9.2.tar.gz
- Upload date:
- Size: 48.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d3d89f235c2e3552d1348c285e9426375db9ff24b90d8153b94165d2f233f51
|
|
| MD5 |
443861ccd4eb317f27953e2191c01733
|
|
| BLAKE2b-256 |
f74ae0dfd1d032df85e0fc794cdf19471e94b6264c586c715a6928ff191fe900
|
Provenance
The following attestation bundles were made for django_import_export_extensions-1.9.2.tar.gz:
Publisher:
publish.yml on saritasa-nest/django-import-export-extensions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_import_export_extensions-1.9.2.tar.gz -
Subject digest:
6d3d89f235c2e3552d1348c285e9426375db9ff24b90d8153b94165d2f233f51 - Sigstore transparency entry: 674736013
- Sigstore integration time:
-
Permalink:
saritasa-nest/django-import-export-extensions@176187873bf9b276ac09a6bf17692953049386e2 -
Branch / Tag:
refs/tags/1.9.2 - Owner: https://github.com/saritasa-nest
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@176187873bf9b276ac09a6bf17692953049386e2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file django_import_export_extensions-1.9.2-py3-none-any.whl.
File metadata
- Download URL: django_import_export_extensions-1.9.2-py3-none-any.whl
- Upload date:
- Size: 76.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
800ad38df2a22bd3d21f9f19a9c5ac2d1cd647f64776e5b0287212c89301495e
|
|
| MD5 |
00a9db41fa8ad6edec72bfd2ff430a9a
|
|
| BLAKE2b-256 |
579c38e34e1353259614b8f281f6d2bedfb21010e37074c64437abde25bc42bd
|
Provenance
The following attestation bundles were made for django_import_export_extensions-1.9.2-py3-none-any.whl:
Publisher:
publish.yml on saritasa-nest/django-import-export-extensions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_import_export_extensions-1.9.2-py3-none-any.whl -
Subject digest:
800ad38df2a22bd3d21f9f19a9c5ac2d1cd647f64776e5b0287212c89301495e - Sigstore transparency entry: 674736023
- Sigstore integration time:
-
Permalink:
saritasa-nest/django-import-export-extensions@176187873bf9b276ac09a6bf17692953049386e2 -
Branch / Tag:
refs/tags/1.9.2 - Owner: https://github.com/saritasa-nest
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@176187873bf9b276ac09a6bf17692953049386e2 -
Trigger Event:
release
-
Statement type: