2020-12-04 23:09

django celery beat not executing any tasks.

I've followed the tutorial seen here: https://www.merixstudio.com/blog/django-celery-beat/

I've added django-celery-beat to installed apps and migrated it. Then I've added a custom task, that Django_celery_beat discovers itself with no problems.


import os
from celery import Celery

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'helius.settings.local')

app = Celery('helius')
app.config_from_object('django.conf:settings', namespace='CELERY')

My settings.py is:

CELERY_BROKER_URL = 'amqp://localhost'
CELERY_TIMEZONE = 'Europe/Copenhagen'
CELERYBEAT_SCHEDULER = 'django_celery_beat.schedulers:DatabaseScheduler'

And I then execude django-celery-beat with this command to do the testing: celery -A proj beat -l ERROR --scheduler django_celery_beat.schedulers:DatabaseScheduler

When I run the above command the only task discovered is celery.backend_cleanup. If I try to run the custom task with the bulk action run task nothing happens.

Can someone see what my problem is? In advance thanks to anyone reading thru this :)

Have a fantastic day. Best regards Alexander

====EDIT==== BTW yes I do have a worker running!


  • 点赞
  • 回答
  • 收藏
  • 复制链接分享