简体   繁体   English

如何使用Ajax检查django-celery任务的状态和结果?

[英]How can I use Ajax to check the status and result of a django-celery task?

The Django Celery documentation suggests there are URLs I can check to get the status of a task. Django Celery文档建议我可以检查URL以获取任务的状态。 What are these URLs? 这些网址是什么?

To access these URLs, you need to include them from one of your urls.py files. 要访问这些URL,您需要从其中一个urls.py文件中包含它们。 For example: 例如:

urlpatterns = patterns('',
    url('^tasks/', include('djcelery.urls')),
)

You would then access them using, for example, http://example.com/tasks/{{ task_id }}/status/ . 然后,您可以使用例如http://example.com/tasks/{{ task_id }}/status/访问它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM