[Django]-Celery Django – customize task discovery

3👍

According to the celery docs, since celery version 3.1 one doesn’t need the django-celery app anymore, as django support is integrated into celery itself already.

As per the tutorial, one just needs an imported app object (instance of celery.Celery) imported in the project’s __init__.py

app.autodiscover_tasks accepts two arguments,

  • packages, which can easily be lambda: settings.INSTALLED_APPS
  • related_name, which defaults to tasks, but it can be overwritten
👤zsepi

Leave a comment