Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #27

Open
phatberstromgg opened this issue Jan 14, 2020 · 5 comments
Labels
question Further information is requested

Comments

@phatberstromgg
Copy link

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.

@czue
Copy link
Owner

czue commented Jan 14, 2020

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.

@czue czue added the question Further information is requested label Jan 14, 2020
@phatberstromgg
Copy link
Author

Thank you @czue, I am trying to figure out the problem. I will come back soon.

@aleksandr-smechov
Copy link

aleksandr-smechov commented Feb 2, 2020

@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.

@czue
Copy link
Owner

czue commented Feb 3, 2020

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)

@raynus
Copy link

raynus commented Jul 4, 2021

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 %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants