views:

32

answers:

1

I just installed and configured Celery with RabbitMQ for a Django project and I was having an issue running tasks when I imported them like so:

from someapp.tasks import SomeTask

It worked when I added the project name:

from myproject.someapp.tasks import SomeTask

I tried adding this into the settings.py file but it doesn't change anything:

CELERY_IMPORTS = ("myproject.someapp.tasks",)

I'm fine with leaving the project name on the import line since it works but I'd like to know if there's a way around it or why it has to be that way.

A: 

It's probably because you have

INSTALLED_APPS = ("myproject.someapp", )

Instead you should add the directory containing the apps on the Python path (the project in this case), and simply do

INSTALLED_APPS = ("someapp", )

IMHO this makes more sense for an "app" anyway.

asksol
@asksol: This is good to know and I made the change to my settings file but now the task does not fire anymore. Everything else still works but the task does not run.
knuckfubuck
does not run? Is it listed in the task list part of the splash screen when starting celeryd?
asksol