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.