Тёмный

Django + Celery: Storing Results & Concurrency 

Bennett Garner
Подписаться 4,7 тыс.
Просмотров 5 тыс.
50% 1

Опубликовано:

 

25 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 20   
@markomaksimovic6285
@markomaksimovic6285 2 года назад
Simple yet great example for showing how the basics of Celery work. Honestly one of the better videos out there, thank you
@BennettGarner
@BennettGarner 2 года назад
Glad it was helpful!
@sakthiveljayabal
@sakthiveljayabal 2 года назад
I am exactly looking for similar video. Thanks Please post more video.
@sainathenaganti3041
@sainathenaganti3041 2 года назад
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. ?
@BennettGarner
@BennettGarner 2 года назад
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!
@thomasweiss7613
@thomasweiss7613 8 месяцев назад
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?
@DirtySouth33T
@DirtySouth33T Год назад
great video, thanks man. can i ask is there any benefit to rabbitmq vs redis for the actual broker? in terms of costs for a small app. thanks again
@BennettGarner
@BennettGarner Год назад
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
@oussamaeddahri9098
@oussamaeddahri9098 2 года назад
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.
@BennettGarner
@BennettGarner 2 года назад
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.
@faaizsultan7301
@faaizsultan7301 11 месяцев назад
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.
@BennettGarner
@BennettGarner 11 месяцев назад
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.
@dodokwak
@dodokwak 2 года назад
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.
@BennettGarner
@BennettGarner 2 года назад
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
@dodokwak 2 года назад
@@BennettGarner Thanks. It's useful but doesn't contain much info about the deployment.
@BennettGarner
@BennettGarner 2 года назад
@@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!
@dodokwak
@dodokwak 2 года назад
@@BennettGarner Thank you very much.
@amirhosein_roodgarroodgar7535
@amirhosein_roodgarroodgar7535 2 года назад
thanks thats really helpful
@BennettGarner
@BennettGarner 2 года назад
Glad to hear that!
@TechWithSabri
@TechWithSabri 2 года назад
use it with speed 1.25 better
Далее
МЭЙБИ БЭЙБИ - Hit Em Up (DISS)
02:48
Просмотров 268 тыс.
Китайка и Пчелке Холодно😂😆
00:21
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
Django + Celery: Create Your First Background Worker!
17:21
Coding a Web Server in 25 Lines - Computerphile
17:49
Просмотров 341 тыс.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Просмотров 207 тыс.
Towards Django Two Factor Authentication Integration
46:23