Installation and configuration
Stable release
To install django-import-export-extensions
, run this command in your terminal:
$ pip install django-import-export-extensions
This is the preferred method to install django-import-export-extensions
, as it will always install the most recent stable release.
If you don’t have pip installed, this Python installation guide can guide you through the process.
Then just add import_export
and import_export_extensions
to INSTALLED_APPS
# settings.py
INSTALLED_APPS = (
...
"import_export",
"import_export_extensions",
)
And then 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
Celery
You need to set up Celery to use background import/export. Just plug in Celery and you don’t need additional settings.
From sources
The sources for django-import-export-extensions can be downloaded from the Github repo.
You can either clone the public repository:
$ git clone https://github.com/saritasa-nest/django-import-export-extensions
Or download the tarball:
$ curl -OJL https://github.com/saritasa-nest/django-import-export-extensions/tarball/master
Once you have a copy of the source, you can install it with:
$ make install
Settings
You can configure the following in your settings file:
IMPORT_EXPORT_MAX_DATASET_ROWS
Sets the maximum number of lines in the file to import in order to avoid memory
overflow. The default value is 10,000. If there are more lines in the file,
a ValueError
exception will be raised on import.
MIME_TYPES_MAP
Mapping file extensions to mime types to import files. Default is mimetypes.types_map.
Settings from django-import-export
There are also available settings from original django-import-export package.
Only IMPORT_EXPORT_TMP_STORAGE_CLASS
setting does not affect anything, because the storage
is not used in CeleryImportAdminMixin
implementation.