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!
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.
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.
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)
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?
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
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.
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
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
@@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:)
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?
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
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.
Only channel on youtube covering this, been helpful. Thanks a ton :)
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.
This is a criminally underviewed video; helped me a lot! Thank you!
Glad it helped you!
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!
Great video and worked really well when assigning a workr as --pool=solo for windows users
Thanks again for another great video Anthony... please make more videos like this!!
Awesome! You made my day! Thank you for the awesome video.
Thanks for clear explanation.
Hey Anthony, Thanks for another great video. Your videos deserve more views and likes.
Thank you very much i just need this and you uploaded the video. What a coincidence?😄
That's awesome! I'm glad I could help.
Wow! Loved it. Unique content
I'm glad you liked it!
Man you are just awesome. I always follow your videos 👏👏
work as a charm
Thank you.
Please upload for flask as well.
I'll look into making one for Flask.
@@prettyprinted Thank you very much. :) You are awesome 👏
how to get redis url?
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.
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.
Please make an app based on react and django
Awesome as ever.
Thanks for watching!
Cool video.Does celery support windows now?
Thanks a lot!
Is it Necessary to use redis broker ?
its important to add -------- 'DIRS': [os.path.join(BASE_DIR, 'templates')] in your settings.py
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
?
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)
How to get this live response in react js?
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?
Same problem here
I figured out how to fix it. Compile Celery with "--pool=solo" argument.
Example: celery -A progress worker -l info --pool=solo
@@andrehenriquemendes7270 Thanks man this helped!
Thank you ! thanks kinda cool
Glad you liked it!
Hi Anthony Can you please do a flask one?
I'll look into making a Flask version.
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
Celery results is always empty. I don't know whats lacking. can you please help
Same problema here. Did you fix it?
I figured out how to fix it. Compile Celery with "--pool=solo" argument.
Example: celery -A progress worker -l info --pool=solo
@@andrehenriquemendes7270 Thanks! This worked for me.
@@andrehenriquemendes7270 You are the GOAT man! Thank you!!
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?
Hii, how to redirect to another page after progress bar shows success...
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.
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.
I very much agree with you
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
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
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
@@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:)
task is not getting reflected in database
Not getting Task Results in Django Admin..! CAn some one help?
Warninig. Redis url in app/nameapp/settings, Config Vars.
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?
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
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.
celery looks very over engineered.
maybe in this example. But in a prod setting with any amount of traffic it is capable of handling large task queues.