Je suis en train de courir avec le céleri et IronMQ cache dans un projet Django sur Heroku, mais je reçois ce qui suit:Céleri, Django, Heroku - ImportError: Aucun module nommé tâches
2013-04-14T22:29:17.479887+00:00 app[celeryd.1]: ImportError: No module named tasks
Qu'est-ce que je fais faux? Ce qui suit est mon code pertinent et djcelery et mon application sont à la fois dans les applications installées:
EXIGENCES (Lapin AMQP est là-bas parce que j'ai essayé avant 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
REGLAGES:
BROKER_URL = 'ironmq://'
CELERY_RESULT_BACKEND = 'ironcache://'
import djcelery
import iron_celery
djcelery.setup_loader()
TÂCHES:
from celery import task
@task()
def batchAdd(result_length, result_amount):
VUES:
from app import tasks
r = batchAdd.delay(result_length, result_amount)
return HttpResponse(r.task_id)
également pu essayer (dans les vues):
from tasks import batchAdd
r = batchAdd.delay(result_length, result_amount)
return HttpResponse(r.task_id)
ET ESSAYÉ CE AINSI (dans les vues):
from app.tasks import batchAdd
r = batchAdd.delay(result_length, result_amount)
return HttpResponse(r.task_id)
Aussi voici ma 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
'de tasks' d'importation app est où il se casse. Pourrions-nous voir votre structure entière pour votre application s'il vous plaît? –
Bien sûr. Ajouté – user2270029