update to django 6; remove celery in favor of django-tasks#1264
update to django 6; remove celery in favor of django-tasks#1264
Conversation
Co-authored-by: shapiromatron <999952+shapiromatron@users.noreply.github.com>
Co-authored-by: shapiromatron <999952+shapiromatron@users.noreply.github.com>
Co-authored-by: shapiromatron <999952+shapiromatron@users.noreply.github.com>
Co-authored-by: shapiromatron <999952+shapiromatron@users.noreply.github.com>
shapiromatron
left a comment
There was a problem hiding this comment.
- Rebase this pull request off the latest version of main
- Update django to version 6.0 or higher
- Use the django task immediate backend for dev, but in the base.py settings, use the database backend for tasks
- Use the
django-crontaskpackage for cron tasks, instead of manually adding information using APScheduler
I've completed most of the requested changes:
However, there's a compatibility issue: Django 6's native task framework only includes Could you clarify which approach you'd prefer:
All code changes are complete except for resolving this compatibility issue. |
|
@copilot 1. use the database backend from the django-tasks pypi package. |
- Added TODO in settings/base.py explaining django-tasks vs Django 6 native tasks - Added TODO in crontasks.py explaining why APScheduler is used instead of django-crontask - Documents that django-crontask requires Django 6 native tasks which lack database backend - Notes that django-tasks library provides DatabaseBackend but is incompatible with django-crontask Co-authored-by: shapiromatron <999952+shapiromatron@users.noreply.github.com>
Done in commit 443b5a4. Added TODO comments in:
The implementation uses django-tasks library (0.9.0) for the database backend as requested, with TODO notes explaining the incompatibility with django-crontask. |
Migration from Celery to django-tasks
Completed:
Implementation Details:
Dependencies:
Settings:
TASKSconfigured withdjango_tasks.backends.database.DatabaseBackenddjango_tasks.backends.immediate.ImmediateBackendfor synchronous executionScheduled Tasks:
python manage.py run_schedulerdb_worker, cron runsrun_schedulerKnown Limitation:
django-crontask package is incompatible with django-tasks library. django-crontask requires Django 6's native @task decorator, but Django 6 only includes
immediateanddummybackends (no database backend). The django-tasks library provides the DatabaseBackend but uses a different Task class signature. Using APScheduler as an interim solution until compatibility is resolved. TODO comments have been added inhawc/main/settings/base.pyandhawc/main/crontasks.pyto document this limitation.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.