getting error Received unregistered task of type 'mytasks.add'

I have written a file

from celery import Celery

celery = Celery("tasks",

def add(x,y):
        return x+y

and as follow

from mytasks import add


I have started redis server and I have started celery server. but when i m running then i am getting the following error:

    Received unregistered task of type 'mytasks.add'.
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 for more information.

The full contents of the message body was:
{'retries': 0, 'task': 'mytasks.add', 'eta': None, 'args': (1, 1), 'expires': None, 'callbacks': None, 'errbacks': None, 'kwargs': {}, 'id': 'a4792308-d575-4de4-8b67-26982cae2fa4', 'utc': True} (173b)

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/worker/", line 411, in on_task_received
    strategies[name](message, body, message.ack_log_error)
KeyError: 'mytasks.add'

what may be the possibel reason


Hey I have solved the problem i did one thing i add


in my file and i got succeed.

Need Your Help

What location is a Cron called from?

php json file-io cron

I have created a simple PHP script that is executed by a CRON daemon on my remote webserver. Every few minutes, the script looks up some JSON data on another website, and stores the results in a fi...