Celery "received unregistered task"
<p>I'm new to celery and was trying to use it in my app. Below is my basic app structure</p>

<pre><code> my_app
 |-run.py
 |-app
    |-mod1
    |-mod2
    |-tasks
       |-__init__.py
       |-email
       |-other_tasks_file
</code></pre>

<p>I want to confine all my background tasks to my tasks module . In the <strong>init</strong>.py of tasks i have </p>

<pre><code>from celery import Celery

celery = Celery('my_app', broker='redis://localhost:6379/0')
</code></pre>

<p>within my tasks/email i have</p>

<pre><code>from app.tasks import celery

@celery.task
def send_email():
    #do stuff
</code></pre>

<p>from the terminal i start a worker using</p>

<pre><code> celery -A app.tasks worker --loglevel=DEBUG
</code></pre>

<p>But my task does not show up in celery's task list . Also, once i run my task from the interpreter like so</p>

<pre><code>&gt;&gt;from app.tasks import email
&gt;&gt;email_result = email.send_email.delay()
</code></pre>

<p>When i do this i get the following response in my celery terminal</p>

<pre><code>Received unregistered task of type 'app.tasks.emails.send_email'.
The message has been ignored and discarded.

Did you remember to import the module containing this task?
Or maybe you are using relative imports?
Please see url for more information.

The full contents of the message body was:
{'kwargs': {}, 'taskset': None, 'id': '51e8f766-e772-4d85-bad0-5a6774ea541a', 'eta': None, 'timelimit': (None, None), 'args': [], 'retries': 0, 'task': 'app.tasks.emails.send_email', 'utc': True, 'errbacks': None, 'chord': None, 'expires': None, 'callbacks': None} (283b)
Traceback (most recent call last):
File "/usr/local/lib/python3.4/site-packages/celery/app/utils.py", line 235, in find_app
sym = symbol_by_name(app, imp=imp)
File "/usr/local/lib/python3.4/site-packages/celery/bin/base.py", line 492, in symbol_by_name
return symbol_by_name(name, imp=imp)
File "/usr/local/lib/python3.4/site-packages/kombu/utils/__init__.py", line 101, in symbol_by_name
return getattr(module, cls_name) if cls_name else module
AttributeError: 'module' object has no attribute 'tasks'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.4/site-packages/celery/worker/consumer.py", line 456, in on_task_received
strategies[name](message, body,
KeyError: 'app.tasks.channels.send_email'
</code></pre>

<p>I am using python 3.4 and celery 3.1.23</p>