An Example of Celery in a Flask App With Multiple Files

  Рет қаралды 20,976

Pretty Printed

Pretty Printed

Күн бұрын

Get Celery working in a Flask app that uses the application factory pattern to avoid any issues with importing the Celery tasks into your app.
WORK WITH ME👇🏼
✅ Implement features and fix bugs in your app: Live, one-on-one screenshare
prettyprinted....
💻 Code written in video
prettyprinted....

Пікірлер: 32
@ТимурКотов-о4е
@ТимурКотов-о4е Ай бұрын
thank you so much bro Its pretty hard to get how flask works with it's contexts and flask app extensions. You've helped me a lot Also need to say that celery_init_app function in flask docs changed and now you don't need write app.set_default() in __init__.py. It's already in celery_init_app function
@КонстантинСавин-к2я
@КонстантинСавин-к2я Жыл бұрын
Great video! I think if we move adding user to database after for loop, we can actually cancel adding user to the database.
@prettyprinted
@prettyprinted Жыл бұрын
Yup that's definitely a possibility. Thanks for watching!
@iTaLiAnRoCkErA7X
@iTaLiAnRoCkErA7X 11 ай бұрын
I am attempting to run your example on my local machine. I keep getting an error when I enter "docker compose up" in the terminal. The flask & celery parts exit with code 1 & code 2 both stating "AttributeError: 'cached property' object has no attribute 'lock' ". Im not sure where to look to fix this as it doesn't seem to show up anywhere on google.
@abraham_o
@abraham_o 8 ай бұрын
🌹 I love your approach. But please can you like provide a little bit of reference to a standalone queue with celery, without having to bind it to flask.
@jesterlw
@jesterlw Жыл бұрын
New subscriber here. I've been watching a lot of your videos on flask from 5+ years ago. I really appreciate it. Keep up the good work!
@AlexanderFraser-dk6sc
@AlexanderFraser-dk6sc 5 ай бұрын
Do you need to pass self?
@jijojoseph2041
@jijojoseph2041 11 ай бұрын
there were couple of things you have mentioned while working with flask. if we were to use fastapi , are these things still applies, like the context and all?
@ElieTAILLARD
@ElieTAILLARD 2 ай бұрын
Is it possible to start the project without docker ?
@TomiHakkarainen
@TomiHakkarainen 12 күн бұрын
Totally possible you could deploy flask, celery and sqlite running without Docker, in the old school way, no prob. Just run the apps directly on your server where you have the code 😊
@karldeskolas
@karldeskolas 10 ай бұрын
Hey Man, you seem like you know your stuff! I sure dont! Which is why im wondering, has anyone here or you directly ever tried emitting signals with flask-socketio from a external celery worker process? I cannot figure out how this should work, quite the noob ngl...
@alexdin1565
@alexdin1565 Жыл бұрын
please can you add videos about django celery and ajax
@prettyprinted
@prettyprinted Жыл бұрын
This video might be useful: kzbin.info/www/bejne/eJOzpKp_ptNljKs
@marko90000
@marko90000 Жыл бұрын
that thing sleep 45 seconds learn mathematics anthony.
@arturkabitcher
@arturkabitcher Жыл бұрын
Awesome content!
@prettyprinted
@prettyprinted Жыл бұрын
Thanks for watching!
@kedychang
@kedychang 2 ай бұрын
Really help to understand celery with flask, thanks for your video.
@terrencemoore8739
@terrencemoore8739 12 күн бұрын
This was the video i needed! Thank you! All celery videos are super simple since kost people watching them are noobs but a lot of us are working on real projects and the documentation does not explain whats going wrong.
@buxA57
@buxA57 Жыл бұрын
hello, i cant see print statement that is inside of shared task when i call it edit: it seems to be problem with delay() task is recieved but not executed, if i change delay to run it works. Still dont know how to make delay work edit2: adding ' -P solo' to 'celery -A run worker --loglevel INFO -P solo' fixed the issue
@agb2557
@agb2557 Жыл бұрын
Ahhh I could've done with this video sooner lol, I ended up hacking together my own background task implementation with redis and rabbit (Really struggled to make celery work with the factory pattern) I think I'll revert to using celery with your implementation as its way more robust, thanks!
@_letsBug
@_letsBug 27 күн бұрын
Thankyou soo much
@eddwinnas
@eddwinnas Жыл бұрын
90% of example are too simple ty for this
@yomajo
@yomajo Жыл бұрын
Half year ago tried celery to work with app factory, gave up eventually, went with rq... Need simple compute in the background, uses separate app instance, but at least have no weirdness like celery does, e.g. returning app, celery from main factory function...
@SomethingRandomChannel
@SomethingRandomChannel 3 ай бұрын
Awesome man thank you
@eduardmart1237
@eduardmart1237 Жыл бұрын
Can you explain flasks contexts especially with celery?
@DanielObregon201087
@DanielObregon201087 Жыл бұрын
HI! How I can load .env file in celery?
@bernardhuxley5984
@bernardhuxley5984 Жыл бұрын
Great Content!
@langoonasse771
@langoonasse771 Жыл бұрын
I currently have a bug we’re whenever two users login to my flask app and refresh a few time s the other users information gets displayed. When I comment out all clergy code everything works fine. Any idea what’s going on?
@prettyprinted
@prettyprinted Жыл бұрын
You may have to down Flask-Login to 0.6.1. There's an issue with the newest version.
@squabble3332
@squabble3332 Жыл бұрын
no git link code not work link to example not working too GL for any who search flask example
@prettyprinted
@prettyprinted Жыл бұрын
The code is here: github.com/PrettyPrinted/youtube_video_code/tree/master/2023/01/27/An%20Example%20of%20Celery%20in%20a%20Flask%20App%20With%20Multiple%20Files
@squabble3332
@squabble3332 Жыл бұрын
@@prettyprinted thx man, i have a great an important note for those who find a celery working example with WINDOWS if u starting celery and all of ur tasks are PENDING, that u must change in confinguration _________________ task_ignore_result=False, track_started=True ________________ AND add the flag into celery start script ________________ celery -A worker -P solo >>>>[ WARN HERE -P solo] ________________ and now ur tasks succesfully performs
FastAPI - Фоновые задачи с Celery, Redis и Flower #9
20:45
Артём Шумейко
Рет қаралды 37 М.
How to Use Flask-SQLAlchemy With Flask Blueprints
20:10
Pretty Printed
Рет қаралды 36 М.
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 28 МЛН
Spongebob ate Patrick 😱 #meme #spongebob #gmod
00:15
Mr. LoLo
Рет қаралды 17 МЛН
Asynchronous Tasks in Python - Getting Started With Celery
9:07
Pretty Printed
Рет қаралды 148 М.
From crontab to celery with no regrets by Marco Pavanelli
32:03
PyCon Sweden
Рет қаралды 3,8 М.
Airflow for Beginners: Build Amazon books ETL Job in 10 mins
13:13
Sunjana in Data
Рет қаралды 4,9 М.
Running Asynchronous Tasks with Celery
24:42
Ssali Jonathan
Рет қаралды 1 М.
Task Queues: A Celery Story
29:39
PyCon AU
Рет қаралды 37 М.
Creating a Chat App With Flask-SocketIO (2023)
24:31
Pretty Printed
Рет қаралды 29 М.
Organizing a Flask Project Beyond Single File
9:38
Pretty Printed
Рет қаралды 33 М.
Python Celery Distributed Task Queue | End to End Application with Celery
20:10
Creating a Progress Bar for Celery Task Progress in a Flask App
23:21
Pretty Printed
Рет қаралды 2,3 М.