4

I am trying to run task with Celery. I follow this tutorials link

Everything has been setup successfully. The thing now is that I don't know how to execute a task. I run celeryd and it couldn't find the task. I want to know what exactly I need to call to execute the task and how I need to config the task on RabbitMQ server, django-admin.. I cannot find any full tutorials about it.

3 Answers 3

4

Django by example has a full section on using Celery with RabbitMQ. There are also free tutorials or articles on this topic

Sign up to request clarification or add additional context in comments.

Comments

2

task definition app/tasks.py:

from celery import shared_task

@shared_task
def add(param1,param2)
  print("task")

task execution:

from celery import current_app
current_app.send_task("app.tasks.add", ["param1", "param2"])

Comments

0

This might help you to get an idea how to run Celery.

It worked fine for me.

http://www.hiddentao.com/archives/2012/01/27/processing-long-running-django-tasks-using-celery-rabbitmq-supervisord-monit/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.