Celery, Django, Heroku — ImportError: No module named tasks

I am trying to run celery with IronMQ and cache in a Django project on Heroku but I am receiving the following:

2013-04-14T22:29:17.479887+00:00 app[celeryd.1]: ImportError: No module named tasks

What am I doing wrong? The following is my relevant code and djcelery and my app are both in installed apps:

REQUIREMENTS (Rabbit AMQP is in there because I tried that before IronMQ):

Django==1.5.1
amqp==1.0.11
anyjson==0.3.3
billiard==2.7.3.27
boto==2.8.0
celery==3.0.18
dj-database-url==0.2.1
django-celery==3.0.17
django-storages==1.1.8
gunicorn==0.17.2
iron-cache==0.2.0
iron-celery==0.3.1
iron-core==1.0.2
iron-mq==0.4
iso8601==0.1.4
kombu==2.5.10
psycopg2==2.4.6
python-dateutil==2.1
pytz==2013b
requests==1.2.0
six==1.3.0
wsgiref==0.1.2

PROCFILE:

web: gunicorn myapp.wsgi
celeryd: celery -A tasks worker --loglevel=info -E

SETTINGS:

BROKER_URL = 'ironmq://'
CELERY_RESULT_BACKEND = 'ironcache://'

import djcelery
import iron_celery

djcelery.setup_loader()

TASKS:

from celery import task
@task()
def batchAdd(result_length, result_amount):

VIEWS:

from app import tasks
r = batchAdd.delay(result_length, result_amount)
return HttpResponse(r.task_id)

ALSO TRIED (in VIEWS):

from tasks import batchAdd
r = batchAdd.delay(result_length, result_amount)
return HttpResponse(r.task_id)

AND TRIED THIS AS WELL (in VIEWS):

from app.tasks import batchAdd
r = batchAdd.delay(result_length, result_amount)
return HttpResponse(r.task_id)

Also here is my structure:

projectname
--app
----__init__.py
----__init__.pyc
----admin.py
----admin.pyc
----forms.py
----forms.pyc
----models.py
----models.pyc
----tasks.py
----tests.py
----views.py
----views.pyc
--manage.py
--Procfile
--projectname
----__init__.py
----__init__.pyc
----settings.py
----settings.pyc
----static
----templates
----urls.py
----urls.pyc
----wsgi.py
----wsgi.pyc
--requirements.txt

Answers


Have you tried to load celery via manage.py ?

python manage.py celery worker --loglevel=info

Need Your Help

Which open-source C++ projects have good (inspiring) tests?

c++ unit-testing testing open-source tdd

What are inspiring examples of open-source software written in C++ with great tests?

PHP readfile vs. file_get_contents

php function filesystems readfile

I have used following code to generate zip

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.