I'm trying to set up Django-celery-beat in order to create periodic tasks. My configuration is as follows:
from celery import Celery
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local')
celery = Celery(broker="django-db")
celery.autodiscover_tasks()
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TIMEZONE = 'UTC'
CELERY_ENABLE_UTC = True
CELERY_BEAT_SCHEDULER = 'django_celery_beat.schedulers.DatabaseScheduler'
I'm trying to use Django as database and run both the beat service and the workers.
When I launch the workers like this:
celery -A monitoring worker --loglevel=DEBUG --app=config.settings.local
... I get:
ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@django-db:5672//: [Errno 8] nodename nor servname provided, or not known.
And when I try it when beat:
celery -A monitoring beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler --app=config.settings.local
I get this error:
ERROR/MainProcess] beat: Connection error: [Errno 8] nodename nor servname provided, or not known. Trying again in 4.0 seconds...
I'd like to be able to create periodic tasks through the Django admin but I'm stuck at this point so any help is welcome.