I went through this example here:
http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
All my tasks are in files called tasks.py.
With Django 1.7.5, Celery 3.1.17, and Python 2.7.6 I found that I was still getting these ImportError: cannot import name Celery
. But only when running tests under PyCharm 4.0.4.
I found that a solution was not to rely on from __future__ import absolute_import
as described in First Steps with Django. Instead I renamed proj/proj/celery.py
to proj/proj/celery_tasks.py
and then changed the content of __init__.py
to match: from .celery_tasks import app as celery_app
. No more multiple instances of files named celery.py
to cause import confusion seemed to be a simpler approach.