我在我的服务器中安装了Django-Celery并尝试通过以下代码发送任务:
$ ./manage.py shell
Python 3.4.3 (default, Oct 14 2015, 20:28:29)
Type "copyright", "credits" or "license" for more information.
IPython 4.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: from OJ.models import *
In [2]: from OJ.tasks import *
In [3]: r=judge_delay.delay(Submit.objects.filter(id=9912)[0])
Run Code Online (Sandbox Code Playgroud)
但我得到了结果
$ ./manage.py celeryd -l debug
[2017-04-26 19:46:46,961: DEBUG/MainProcess] | Worker: …Run Code Online (Sandbox Code Playgroud)