在调用的时候报错,提示未注册hmdbsearch.tasks(hmdbsearch是django项目中的一个app)
-------------- celery@LAPTOP-CMT1I0CL v3.1.26.post2 (Cipater)
---- **** -----
--- * *** * -- Windows-10-10.0.17134-SP0
-- * - **** ---
- ** ---------- [config]
- ** ---------- .> app: default:0x2664f00c400 (.default.Loader)
- ** ---------- .> transport: amqp://guest:**@localhost:5672//
- ** ---------- .> results: disabled://
- *** --- * --- .> concurrency: 8 (prefork)
-- ******* ----
--- ***** ----- [queues]
-------------- .> celery exchange=celery(direct) key=celery
[tasks]
[2018-10-29 16:41:22,202: INFO/MainProcess] Connected to amqp://guest:**@127.0.0.1:5672//
[2018-10-29 16:41:22,313: INFO/MainProcess] mingle: searching for neighbors
[2018-10-29 16:41:23,429: INFO/MainProcess] mingle: all alone
[2018-10-29 16:41:23,451: WARNING/MainProcess] celery@LAPTOP-CMT1I0CL ready.
[2018-10-29 16:41:30,871: ERROR/MainProcess] Received unregistered task of type 'hmdbsearch.tasks.runspider'.
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 http://bit.ly/gLye1c for more information.
The full contents of the message body was:
{'task': 'hmdbsearch.tasks.runspider', 'id': 'a0f8e683-c35d-4d47-914b-39151720f168', 'args': (1,), 'kwargs': {}, 'retries': 0, 'eta': None, 'expires': None, 'utc': True, 'callbacks': None, 'errbacks': None, 'timelimit': (None, None), 'taskset': None, 'chord': None} (271b)
Traceback (most recent call last):
File "d:\myvirtualenv\spider_env\lib\site-packages\celery\worker\consumer.py", line 465, in on_task_received
strategies[type_](message, body,
KeyError: 'hmdbsearch.tasks.runspider'
-------------- celery@LAPTOP-CMT1I0CL v3.1.26.post2 (Cipater)
---- **** -----
--- * *** * -- Windows-10-10.0.17134-SP0
-- * - **** ---
- ** ---------- [config]
- ** ---------- .> app: default:0x2664f00c400 (.default.Loader)
- ** ---------- .> transport: amqp://guest:**@localhost:5672//
- ** ---------- .> results: disabled://
- *** --- * --- .> concurrency: 8 (prefork)
-- ******* ----
--- ***** ----- [queues]
-------------- .> celery exchange=celery(direct) key=celery
[tasks]
[2018-10-29 16:41:22,202: INFO/MainProcess] Connected to amqp://guest:**@127.0.0.1:5672//
[2018-10-29 16:41:22,313: INFO/MainProcess] mingle: searching for neighbors
[2018-10-29 16:41:23,429: INFO/MainProcess] mingle: all alone
[2018-10-29 16:41:23,451: WARNING/MainProcess] celery@LAPTOP-CMT1I0CL ready.
[2018-10-29 16:41:30,871: ERROR/MainProcess] Received unregistered task of type 'hmdbsearch.tasks.runspider'.
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 http://bit.ly/gLye1c for more information.
The full contents of the message body was:
{'task': 'hmdbsearch.tasks.runspider', 'id': 'a0f8e683-c35d-4d47-914b-39151720f168', 'args': (1,), 'kwargs': {}, 'retries': 0, 'eta': None, 'expires': None, 'utc': True, 'callbacks': None, 'errbacks': None, 'timelimit': (None, None), 'taskset': None, 'chord': None} (271b)
Traceback (most recent call last):
File "d:\myvirtualenv\spider_env\lib\site-packages\celery\worker\consumer.py", line 465, in on_task_received
strategies[type_](message, body,
KeyError: 'hmdbsearch.tasks.runspider'