-
-
Notifications
You must be signed in to change notification settings - Fork 816
Description
I propose extending the export functionality in django-import-export
to use background tasks. This would offer several key benefits:
- Improved user experience, as users wouldn’t need to wait for the export to finish.
- Avoiding server timeouts for long-running exports.
- The export process can run asynchronously, freeing up server resources.
In the near future, Django will include integrated support for background workers, as DEP 0014: Background Workers has been accepted and is currently in the implementation phase. For older Django versions, the reference implementation, django-tasks, can be used, making this change backward-compatible with LTS versions like Django 4.2.
This proposal focuses on background task support for exporting only, as background imports introduce more complexity, particularly around handling errors and database changes.
For context, the third-party package django-import-export-celery offers both import and export functionality with Celery but requires a working Celery setup.
More information about django-tasks:
- https://github.com/django/deps/blob/main/accepted/0014-background-workers.rst
- https://forum.djangoproject.com/t/django-tasks-bringing-background-workers-in-to-django-core/32967
- https://www.youtube.com/watch?v=RxcRBNqxjeY
- Fixed #35859 -- Implement Tasks interface as per DEP 14 django/django#18627
Please take a moment to read through the details and share any feedback, suggestions, or concerns you might have.