Тёмный

How to Create a Celery Task Progress Bar in Django 

Pretty Printed
Подписаться 97 тыс.
Просмотров 45 тыс.
50% 1

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

 

25 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 65   
@steventeglman
@steventeglman Год назад
This is a criminally underviewed video; helped me a lot! Thank you!
@prettyprinted
@prettyprinted Год назад
Glad it helped you!
@pardhabandaru1105
@pardhabandaru1105 3 года назад
most tutorials edit the messed up parts and show them as smooth flow. but you admitin and showing the error and fixing is very helpful. Thanks a lot.
@down__lo7359
@down__lo7359 3 года назад
Only channel on youtube covering this, been helpful. Thanks a ton :)
@ShaunCullen
@ShaunCullen 3 года назад
Thanks for highlighting how to manually request the task progress, this makes it useful for people using Django as just an API using DRF. Much appreciated!
@MarceloAgostonSchrotlin
@MarceloAgostonSchrotlin 3 года назад
Thanks again for another great video Anthony... please make more videos like this!!
@CryptoWizards
@CryptoWizards 3 года назад
Great video and worked really well when assigning a workr as --pool=solo for windows users
@numanfarukh1645
@numanfarukh1645 3 года назад
Thanks for clear explanation.
@tekbahadurkshetri4327
@tekbahadurkshetri4327 4 года назад
Thank you very much i just need this and you uploaded the video. What a coincidence?😄
@prettyprinted
@prettyprinted 4 года назад
That's awesome! I'm glad I could help.
@anubhavsidhu23
@anubhavsidhu23 4 года назад
Hey Anthony, Thanks for another great video. Your videos deserve more views and likes.
@kaithojuranjith9522
@kaithojuranjith9522 4 года назад
Man you are just awesome. I always follow your videos 👏👏
@Ali-ts6po
@Ali-ts6po 4 года назад
Awesome! You made my day! Thank you for the awesome video.
@mahmudsajib8648
@mahmudsajib8648 4 года назад
Wow! Loved it. Unique content
@prettyprinted
@prettyprinted 4 года назад
I'm glad you liked it!
@nextgodlevel
@nextgodlevel 5 месяцев назад
if want to send this progress over to a React project which is currently using REST API from django backend how I can achieve that ?
@MrJplattus
@MrJplattus 4 года назад
work as a charm
@gideonz74b
@gideonz74b 2 года назад
It's a great video, thanks! What would really help is to have a block diagram that shows what elements are used and how they talk to each other. It is hard to grasp like this (with as little background as I have), and because of that, it looks unnecessarily complex. In other words, the necessity for this complexity is not explained.
@DetectiveMichealScarn
@DetectiveMichealScarn 2 года назад
Which part is too complex specifically? if you mean the general reason why you would use this, in that case it's more for running things you know are going to take a lot of time, have many steps, some of which could fail, and more along these lines. Celery is something I would say most don't use. I am for example only using it for the first time in my 7 year Development Career because I need to create an Application for working with an AI, one which has a lot of steps, which I want to communicate to the user.
@susanca8443
@susanca8443 Год назад
Why does the index page say 'done' while the progress is still building up? i.e. If it is already done, then what is the need for the progress bar.
@x20x200
@x20x200 2 года назад
Thank you.
@rahulpatel4701
@rahulpatel4701 4 года назад
how to get redis url?
@cookdonald6222
@cookdonald6222 4 года назад
Cool video.Does celery support windows now?
@satkarphuyal6802
@satkarphuyal6802 3 года назад
My code is working properly and the celery worker is also working properly but I don't see anything in django admin . What might be the problem?
@juantascon3870
@juantascon3870 3 года назад
Thanks a lot!
@123Freerunninginindi
@123Freerunninginindi 4 года назад
Please upload for flask as well.
@prettyprinted
@prettyprinted 4 года назад
I'll look into making one for Flask.
@123Freerunninginindi
@123Freerunninginindi 4 года назад
@@prettyprinted Thank you very much. :) You are awesome 👏
@mashoodurrehman9840
@mashoodurrehman9840 4 года назад
Awesome as ever.
@prettyprinted
@prettyprinted 4 года назад
Thanks for watching!
@adityanjsg99
@adityanjsg99 8 месяцев назад
Not getting Task Results in Django Admin..! CAn some one help?
@emilseyfullayev1638
@emilseyfullayev1638 3 года назад
Please, please help me, Why I receive this error? I installed ubuntu 20.04, I also connect to redis locally. May I have to change any my laptop configuration settings? [2021-04-11 19:58:44,253: ERROR/MainProcess] consumer: Cannot connect to redis://:**@ec2-54-217-183-159.eu-west-1.compute.amazonaws.com:22600//: Error while reading from socket: (104, 'Connection reset by peer'). Trying again in 26.00 seconds... (13/100)
@namangupta2587
@namangupta2587 4 года назад
Please make an app based on react and django
@stej2248
@stej2248 2 года назад
How to get this live response in react js?
@pablomuniz9021
@pablomuniz9021 4 года назад
Hi, great video. I followed it and my async tasks are working when I run django locally (e.g. runserver), but it doesn’t work when deployed on Heroku. Redis receives the task requests, but they aren’t added to the Heroku postgres database (thus not displaying in the admin app). Any advice?
@andrehenriquemendes7270
@andrehenriquemendes7270 4 года назад
Same problem here
@andrehenriquemendes7270
@andrehenriquemendes7270 4 года назад
I figured out how to fix it. Compile Celery with "--pool=solo" argument. Example: celery -A progress worker -l info --pool=solo
@CryptoWizards
@CryptoWizards 3 года назад
@@andrehenriquemendes7270 Thanks man this helped!
@mohamedmzoughi8234
@mohamedmzoughi8234 2 года назад
Is it Necessary to use redis broker ?
@pathakotasrikar1866
@pathakotasrikar1866 4 года назад
Hii, how to redirect to another page after progress bar shows success...
@syedkabir934
@syedkabir934 3 года назад
its important to add -------- 'DIRS': [os.path.join(BASE_DIR, 'templates')] in your settings.py
@TheAnkur117
@TheAnkur117 4 года назад
Hey, Its not adding tasks to my database table in admin panel, hence rest of the things also not working, can I get the solution. I have followed all steps as it is
@TheAnkur117
@TheAnkur117 4 года назад
Celery results is always empty. I don't know whats lacking. can you please help
@andrehenriquemendes7270
@andrehenriquemendes7270 4 года назад
Same problema here. Did you fix it?
@andrehenriquemendes7270
@andrehenriquemendes7270 4 года назад
I figured out how to fix it. Compile Celery with "--pool=solo" argument. Example: celery -A progress worker -l info --pool=solo
@cselefendi
@cselefendi 3 года назад
@@andrehenriquemendes7270 Thanks! This worked for me.
@saadbutt6938
@saadbutt6938 Год назад
@@andrehenriquemendes7270 You are the GOAT man! Thank you!!
@BohdanDuCiel
@BohdanDuCiel 3 года назад
I still don’t get how you can implement this in a real project, it’s as if you need to know exactly how long your task is gonna run ( which in still manageable by putting a timeout) but the hardest part is knowing where to pinpoint the progress of the task, because nobody’s using sleep() in real applications, so how do you know where and when to update the progress? This would be just the same as showing a filling progress bar to the user with JavaScript while the page loads (in other words faking it) I genuinely want to know how to implement this for a real long running task because it seems unpractical.
@jamesmicker7863
@jamesmicker7863 3 года назад
I very much agree with you
@AnasLahrech
@AnasLahrech 3 года назад
You can set a timer from the beginning of your function and a timer at the end, then make the substraction and set your progress bar right after
@flaviusteodorof2601
@flaviusteodorof2601 2 года назад
for example i have an app where the user can input words, and it will run a function with each of those words. I update the progressbar once a word is done and the user can see 145/500words done
@BohdanDuCiel
@BohdanDuCiel 2 года назад
Now back to this after I have had more experience in software engineering 😅, this is an easy fix: just use a different thread. To get the runtime of the executed function I’d probably warp it in a decorator
@flaviusteodorof2601
@flaviusteodorof2601 2 года назад
@@BohdanDuCiel celery is useful because you can queue multiple tasks. This addon for progress is purely for informational purpose, since in my case the user can input an unlimited number of words, and it's designed for batches of 2-3k words, and each one can take up to 1-2 minutes, it's useful that they can close the browser and check once in a while to see of their session is complete. It's purely a UX thing:)
@forgiveness_denied
@forgiveness_denied 4 года назад
Thank you ! thanks kinda cool
@prettyprinted
@prettyprinted 4 года назад
Glad you liked it!
@AllexRadu
@AllexRadu 3 года назад
I'm trying to conect to redis locally using : "CELERY_BROKER_URL = 'redis://127.0.0.1:6379/1' CELERY_ACCEPT_CONTENT = ['json'] CELERY_TASK_SERIALIZER = 'json' CELERY_RESULT_BACKEND = 'redis'" When I run celery i get: I'm getting an error "ModuleNotFoundError: No module named 'django_celery_results'" I have the module installed. Pip freeze reveals: amqp==5.0.2 asgiref==3.3.1 billiard==3.6.3.0 celery==5.0.4 certifi==2020.12.5 click==7.1.2 click-didyoumean==0.0.3 click-plugins==1.1.1 click-repl==0.1.6 Django==3.1.4 django-celery-results==2.0.0 kombu==5.0.2 prompt-toolkit==3.0.8 pytz==2020.4 redis==3.5.3 six==1.15.0 sqlparse==0.4.1 vine==5.0.0 wcwidth==0.2.5 Can you guys help?
@r4z74
@r4z74 4 года назад
Hi Anthony Can you please do a flask one?
@prettyprinted
@prettyprinted 4 года назад
I'll look into making a Flask version.
@lakshitukani468
@lakshitukani468 3 года назад
task is not getting reflected in database
@VsevoTV-ik9bw
@VsevoTV-ik9bw 3 года назад
Warninig. Redis url in app/nameapp/settings, Config Vars.
@lucsigier2375
@lucsigier2375 8 месяцев назад
If like me your task get send but never succed mind 'pip install eventlet' And launch celry with this following command line : celery -A progress worker --loglevel=info -P eventlet
@evgenyocean426
@evgenyocean426 3 года назад
Unfortunately, the vast majority of youtube tutorials come down to "we do this, we do that, let's paste it here, let's install that". It's just sad. I want to know why we're doing this or that. Otherwise, it's totaly useless. The equevalent of this tutorial is a link to source code. No need for 20 minutes video.
@DouwedeJong
@DouwedeJong 4 года назад
celery looks very over engineered.
@down__lo7359
@down__lo7359 3 года назад
maybe in this example. But in a prod setting with any amount of traffic it is capable of handling large task queues.
Далее
Accepting Payments in Django Using Stripe Checkout
32:39
Sending Emails in Django With Celery
23:20
Просмотров 78 тыс.
Heroku Is Dead, Here's What I Recommend
11:59
Просмотров 264 тыс.
Celery for asynchronous tasks in Django
8:46
Просмотров 7 тыс.
Django | Cron Job | Database User Management
41:30
Просмотров 14 тыс.
Оптимизация Django. 5 - Celery + Docker
30:31