-
Notifications
You must be signed in to change notification settings - Fork 91
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
Is there any way we can integrate this with a react project? #40
Comments
Hey! I have done this but so far only by dropping the JS dependency on the page. I've learned a lot about how JavaScript works since originally creating this. It would be great to package the JS separately and distribute it via NPM so that it can more easily integrate with React and other frameworks. That work is something I'd love to make time for in the future. At the moment, I'm not sure when I'll be able to but would love help or will prioritize when I come back to this lib down the road. |
I think I figured out how to do this |
Hello, I think I have figured out how to do this |
@TWEEDOriginal any more details? Guessing it would be helpful for others. |
In my models.py I created a specific model for task_id so whenever a celery task is initiated with .delay() a new task_id model which contains the task_id is created.
// Django code
result_task = process_document.delay(instance.pk)
ResultTaskID.objects.create(task_id = result_task.task_id)
//
So in my front end(React) I get the task_id via an api call to the server, Then the rest is just like you explained in the documentation.
// Django local host
var resultprogressUrl = `http://127.0.0.1:8000/celery-progress/${actual_result_task_id}`
I also copied your CeleryProgressBar class from your GitHub and I imported it into react the normal way. So to view the progress bar I do this.
CeleryProgressBar.initProgressBar(resultprogressUrl);
… On 30 Sep 2020, at 08:26, Cory Zue ***@***.***> wrote:
@TWEEDOriginal any more details? Guessing it would be helpful for others.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hi there, I think I have to apply a little bit more conditions on the frontend. @czue, @TWEEDOriginal, @aashayamballi, I am expecting your help to improve the integration. Thank you. |
thanks, I took a quick look and it looks like a great resource! |
Hi, thanks for this library,
Can anyone please demonstrate how to use this in a react project with Django/Django Rest Framework backend?
The text was updated successfully, but these errors were encountered: