Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I am struggling with the same thing right now. This is how I see it:</p> <p>There are two ends of the communication application that executes tasks and worker that executes task.</p> <p><strong>Worker does not need to know app!</strong> For the worker part it is just enough to know celeryconfig. You could pass it with celery worker --config=mypackage.celeryconfig. The worker will connect to the queue with BROKER_URL. Remember to declare there CELERY_IMPORTS there so worker would know where to look for task definitions.</p> <p>The client app must know where to send it's requests. So the same configuration must be passed with one of the methods of passing configuration file. I picked this one:</p> <pre><code>from __future__ import absolute_import from celery import Celery celery = Celery() import backend.async.celeryconfig celery.config_from_object(backend.async.celeryconfig) </code></pre> <p>This setup works for me when I run it without deamon, but for some reason deamon ignores my CELERY_CONFIG_MODULE settings.</p> <hr> <p><strong>Update:</strong></p> <p><strong>CELERY_CONFIG_MODULE is not used in /etc/init.d/celeryd script anywhere</strong>! </p> <p>Instead, I put it in CELERYD_OPTS and it works like a charm.:</p> <pre><code>CELERYD_OPTS="--config=backend.async.celeryconfig" </code></pre> <p>The other thing is that VIRTUAL_ENV variable is ignored as well in celeryd script. On the other celerybeat scirpt activates the virtual env, so my adviced config is:</p> <pre><code>CELERYBEAT_OPTS="--schedule=/var/run/celerybeat-schedule --config=backend.async.celeryconfig" VIRTUAL_ENV="/path/to/.virtualenvs/your_env" # Python interpreter from environment. ENV_PYTHON="$VIRTUAL_ENV/bin/python" # How to call "celeryd-multi" CELERYD_MULTI="$VIRTUAL_ENV/bin/celeryd-multi" #CELERYD="$VIRTUAL_ENV/celeryd" # How to call "celeryctl" CELERYCTL="$VIRTUAL_ENV/bin/celeryctl" # How to call "celerybeat" CELERYBEAT="$VIRTUAL_ENV/bin/celerybeat" </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload