Thanks Bennett for explaining this. In the video, you refreshed the web page to see the updated status and results from celery. But is there any way to do this without refreshing the page at all. ?
Good questions! Doing so would require a little bit of JavaScript (AJAX requests) and an API for task statuses. Totally doable and actually not too complicated, but more complicated than I wanted for the video. Another option for asynchronous (no page load) status updates is webhooks. Those might require an async webserver, which Django can do with ASGI, but also more complicated than I wanted for the video!
imagine you have a task which calculates something (lets say you get a dictionary with some key/value pairs) and want the user to accept the result. only then (at least some of) the parameters are stored into the actual model(s). would you create another model to store the calculation results and then write into these models like you did?
They're both stable and either can be a good choice. This is a great answer from Stackoverflow: stackoverflow.com/a/48627555 Here are the official docs comparing the two: docs.celeryq.dev/en/stable/getting-started/backends-and-brokers/index.html#redis
Thank you for this video, although I guess this example is not working well in Windows because Windows doesn't support the celery parallel processing, so it will wait untill celery ends a task to execute the other.
Windows should be able to support parallel processing. But all of my experience has been using Celery in unix environments, so I'm not sure how you'd configure it for Windows. My best suggestion would be to use Docker to run the app.
I came here to undertsand the configurations about the storing results backend, but you didnt go through this. Although your example is good enough to explain the concurrency Celery provides.
This tutorial doesn't describe all the possible results backends and their configurations; you're right. The docs will be far more informative than me on that front.
Thank you. Great example. Could you please make a tutorial how to deploy django application with celery worker(s) without a docker container ( or at least give some advice how to do it) . Thx in advance.
Hey @dodokwak - Check out the "How You Might Deploy It" section of my artice: medium.com/swlh/python-developers-celery-is-a-must-learn-technology-heres-how-to-get-started-578f5d63fab3
@@dodokwak The specifics will be entirely dependent on how you choose to host your web application. At a minimum, you'll need a webserver, celery server, and redis server. On AWS, for example, that could mean one EC2 instance for Django, one EC2 instance for Celery, and an Elasticache instance running Redis. But there are many other potential ways to configure it and many other options for hosting your site. So, I can't fully answer the question because there are many possible answers!