I got the issue NoReverseMatch Reverse for 'task_status' with arguments '('',)' not found. 1 pattern(s) tried: ['celery-progress/(?P<task_id>[\w-]+)/$'] like the post #8
Hi @czue, I have tried your advice but the error still there. In my case, the webpage was worked but when I upload a video, the web shows me the error. It is said the same look as the post of @ludwigwittgenstein2. Could you help me, please? Hope to hear from you soon.
Thank you so much. Best regards.
Hi @phatberstromgg this implies the task ID is blank. The best way to troubleshoot it is to try and figure out why it's blank. It can be because your backend isn't properly configured so the ID is not assigned/returned from the async call, because you're not passing it properly from the view to the template, because you're referencing the wrong variable in the template, etc.
I'd recommend you get to the bottom of why the ID is blank and that should hopefully lead you to the appropriate solution.
Thank you @czue, I am trying to figure out the problem. I will come back soon.
@phatberstromgg If you're putting "{% url 'celery_progress:task_status' task_id %}" in your template, Django will try to process the tag and find task_id empty, even if you're not calling any tasks. If you're getting the task_id from a callback, just use the following, as @czue suggested in the other thread (notice the new single quotes around task_id):
$(function () {
var progressUrl = "{% url 'celery_progress:task_status' 'task_id' %}"
var progressUrl = progressUrl.replace("task_id", response.task_id)
CeleryProgressBar.initProgressBar(progressUrl);
});
@czue This could really use some clarification in the README.
thanks for the clarification @aleksandr-smechov
This could really use some clarification in the README.
Agree! I would welcome a PR clarifying this :) (and will also add to my backlog)
Got stuck on this problem for several days and saw @aleksandr-smechov comment.
I added the condition to check task_id then it works well.
{% if task_id%} // vanilla JS version document.addEventListener("DOMContentLoaded", function () { var progressUrl = "{% url 'celery_progress:task_status' task_id %}"; CeleryProgressBar.initProgressBar(progressUrl); }); {% endif %}