Last active
August 29, 2015 14:00
-
-
Save fduran/11400989 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# www.fduran.com | |
# set up Celery with Django (dev queuing) | |
(source activate) | |
# install (kombu is included) | |
pip install celery | |
pip install django-celery | |
# edit settings.py : | |
INSTALLED_APPS = ( | |
'djcelery', | |
'kombu.transport.django', | |
) | |
import djcelery | |
djcelery.setup_loader() | |
BROKER_URL = 'django://' | |
# run celery | |
sudo -uwww-data /path/to/venv/bin/python ./manage.py celery worker --loglevel=info >> /var/log/celery.log 2>&1 & | |
# set celery up with supervisord | |
cd /path_to/django/project | |
# source ../virtualenv/bin/activate | |
pip install supervisor | |
echo_supervisord_conf > supervisord.conf | |
supervisord.conf file: | |
--- | |
[supervisord] | |
logfile=/var/log/supervisord/supervisord.log | |
[program:celeryd] | |
command=/home/ubuntu/django/virtualenv/bin/python /home/ubuntu/django/boomerang/manage.py celery worker --loglevel=info --config=settings.py | |
user=www-data | |
stdout_logfile=/var/log/celery.log | |
stderr_logfile=/var/log/celery.log | |
autostart=true | |
autorestart=true | |
startsecs=10 | |
stopwaitsecs=600 | |
umask=002 | |
--- | |
# mkdir /var/log/supervisord | |
# touch /var/log/supervisord/supervisord.log | |
# supervisord -c /etc/supervisord.conf | |
# supervisorctl tail celeryd | |
# supervisorctl restart celeryd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment