4

I usually use celery with Django and run shared tasks in Django.

But for specific case, I want to add task queue to rabbitmq manually without running Django or celerybeat.

Is there any simple python script or shell cmd to do that?

1 Answer 1

7

You can use the send_task method to queue a task to an arbitrary celery broker. But, you do have to know the app name and broker url so that you can send the task to the right place.


from celery import Celery

app = Celery('app_name', broker='pyamqp://guest@localhost//')
app.send_task('namespace.my_task', kwargs={
    'arg1': 'value1',
    'arg2': 'value2',
})
Sign up to request clarification or add additional context in comments.

1 Comment

Ah. nice solution. I'll try it and let you know the result.

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.