I try to start a Celery worker server from a command line:
celery -A tasks worker --loglevel=info
The code in tasks.py:
import
Try start celery:
celeryd --config=my_app.my_config --loglevel=INFO --purge -Q my_queue
There is next script in my tasks.py
:
@task(name="my_queue", routing_key="my_queue")
def add_photos_task( lad_id ):
There is next script in my_config.py
:
CELERY_IMPORTS = \
(
"my_app.tasks",
)
CELERY_ROUTES = \
{
"my_queue":
{
"queue": "my_queue"
},
}
CELERY_QUEUES = \
{
"my_queue":
{
"exchange": "my_app",
"exchange_type": "direct",
"binding_key": "my_queue"
},
}
celery = Celery(broker='amqp://guest@localhost//')