This module provide worker for hard work around periodical syncing and updating caches, sending emails or whatever you need do asynchronously.
pip install leonardo-celerypip install django-leonardo[celery]BROKER_URL = 'redis://localhost:6379/0'
BROKER_URL = 'amqp://user:password@127.0.0.1:5672/leonardo'Set custom scheduler and result backend
CELERY_RESULT_BACKEND = 'djcelery.backends.database:DatabaseBackend'
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"python manage.py celery worker -B -EFor syncing state to databse run celerycam
python manage.py celerycamTasks are discovered by standard mechanism:
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
Use cacheback jobs for fetching data asynchronously.
pip install leonardo-celery[cacheback]Define your jobs. More about Jobs http://django-cacheback.readthedocs.org/en/latest/usage.html#as-an-instance-of-cacheback-job
- https://celery.readthedocs.org/en/release21-maint/userguide/monitoring.html#starting-the-monitor
- http://celery.readthedocs.org/en/latest/index.html
- https://github.com/django-leonardo/django-leonardo
- https://github.com/michaelkuty/django-cacheback
- http://django-cacheback.readthedocs.org/en/latest/usage.html#as-an-instance-of-cacheback-job