Closed balazs-endresz closed 9 years ago
Thanks for spotting, could you submit a pull request?
Sure, I was about to, but we should probably make a decision about this first: https://torchbox.codebasehq.com/projects/sysadmin/tickets/2072
I may be reading it wrong, but the import in __init__.py
is there for @shared_task
to work.
Still worth fixing this as I missed it in #23
Considering that django-celery is at 3.1.16 and celery incorporates it as of 3.1.17, I vote for the latter.
D
@zerolab Well, I'm not sure, I haven't used this version of celery before, but this seems to be required for any task not just shared ones. Otherwise django is not aware which celery app to use.
Or, I guess this wouldn't be required if we used
from project_name.celery import app
@app.task
def mytask(): ...
instead of
from celery.decorators import task
@task
def mytask(): ...
Django is trying to connect to rabbitmq on port 5672, which is the default setting for celery. I think we're missing the following from
project_name/project_name/__init__.py
:http://celery.readthedocs.org/en/latest/django/first-steps-with-django.html
I've just tried this and now I don't get a connection refused error when queueing a delayed task.