Process long running django imports and exports in celery
Project description
django-import-export-celery helps you process long running imports in celery.
Setting up imports with celery
A fully configured example project can be found in the example directory of this repository.
Set up celery to work with your project.
Add ‘import_export_celery’ to your INSTALLED_APPS settings variable and configure the IMPORT_EXPORT_CELERY_MODELS variable.
IMPORT_EXPORT_CELERY_MODELS = { "Winner": {'app_label': 'winners', 'model_name': 'Winner'} }
The available parameters are app_label, model_name, and resource.
Done
Preforming an import
You will find an example django application that uses django-import-export-celery for importing data. There are instructions for running the example application in the example directory’s README file. Once you have it running, you can perform an import with the following steps.
Navigate to the example applications admin page:
Navigate to the ImportJobs table:
Create a new import job. There is an example import CSV file in the example/example-data directory. Select that file. Select csv as the file format. We’ll be importing to the Winner’s model table.
Select “Save and continue editing” to save the import job and refresh until you see that a “Summary of changes made by this import” file has been created.
You can view the summary if you want. Your import has NOT BEEN PERFORMED YET!
Return to the import-jobs table, select the import job we just created, and select the “Perform import” action from the actions drop down.
In a short time, your imported Winner object should show up in your Winners table.
Exports are not yet supported but they hopefully will be in a future release. PRs welcome.
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 Distributions
Built Distribution
Hashes for django_import_export_celery-0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13ec44afadc6d66ef4787f6c4a4ed045d6b72d2cbd580df398c4da0f51d233d4 |
|
MD5 | a66693d372e68ec25246809244907a52 |
|
BLAKE2b-256 | 97004e3f56d0a13f2463ede065b76340151560c4e8c0f2a3c06ed9482dc6a07c |