Sending Emails in Django With Celery

  Рет қаралды 77,673

Pretty Printed

Pretty Printed

Күн бұрын

Celery is a nice tool to use when you don't want your users to wait for some process to finish when they request one of your views. In this video, I will show you how to use Celery in Django to send emails, but you can adapt this to any long running process you may want to have in your app.
Need one-on-one help with your project? I can help through my coaching program. Learn more here: prettyprinted.com/coaching
Get the code here: prettyprinted.com/l/XmZ
Join my free course on working with the database and models in Django: prettyprinted.com/djangodata
Celery docs: docs.celeryproject.org/en/lat...
Heroku: www.heroku.com/
Twitter: / pretty_printed
Github: github.com/prettyprinted

Пікірлер: 104
@prettyprinted
@prettyprinted 4 жыл бұрын
Join my free course on working with the database and models in Django: prettyprinted.com/djangodata
@danteanditzel
@danteanditzel 4 жыл бұрын
This was really helpful, I appreciate that you showed the errors that we could encounter when setting up redis and celery on a django app and guided us in solving the issues. Thank you!
@soniaspirling3131
@soniaspirling3131 3 жыл бұрын
This is one of the best sites on django and coding in general. You are crystal clear and you explain everything at a great pace. Thank you for being so helpful to so many!!
@rdx86
@rdx86 4 жыл бұрын
Great tutorial! That spam email from the dating site was just hilarious! They must have some powerful email scrapers running somewhere.
@andrewminhnguyen9446
@andrewminhnguyen9446 4 жыл бұрын
Thanks for this video! Took me a while to find an up-to-date Django/Celery/Heroku tutorial, and I got lucky with yours!
@prettyprinted
@prettyprinted 4 жыл бұрын
Glad you liked the video!
@juanjosemartinromero714
@juanjosemartinromero714 3 жыл бұрын
Great! Thank you very much. Including those usual mistakes we make that allow you to learn deeply
@IlanHarel
@IlanHarel 3 жыл бұрын
Thank you for sharing the failures and problem resolution walkthrough.
@MohammedAbuObaid
@MohammedAbuObaid 3 жыл бұрын
Nice one Anthony! Really good video to get started with Celery in Django Thanks
@delllatitude299
@delllatitude299 4 жыл бұрын
Finally , Django with something unique and one level up
@pratikdjango8208
@pratikdjango8208 2 жыл бұрын
Thanks Anthony !! Well explained Mate
@pitupipitu
@pitupipitu 3 жыл бұрын
Thank you, very clear explanation and to the point!
@nehat786
@nehat786 4 жыл бұрын
Amazing video after long time.
@leandrocosta4283
@leandrocosta4283 4 жыл бұрын
Hello Anthony, I just got to know your channel and I'm loving the videos. do an example of crud with Svelte using Django rest I believe would be a success!
@sumanbanik3339
@sumanbanik3339 3 жыл бұрын
Have been following you since months now, your videos are really helpful, could you make a video for integrating zoom/whereby in Django, I did that once using REST, was quite a task. I'm sure you can show some tricks.
@cassiosalvador7961
@cassiosalvador7961 3 жыл бұрын
Another extremely helpful video, thank you!
@yahyakhan-rr9ei
@yahyakhan-rr9ei 2 жыл бұрын
One of the best video on this topic
@alekseykonotop1745
@alekseykonotop1745 4 жыл бұрын
Thanks a lot for this guide! Liked and Subscribed!
@NiM44
@NiM44 3 жыл бұрын
Simple and really useful , thanks mate
@hoseaochieng5355
@hoseaochieng5355 4 жыл бұрын
This video helped me alot. Thumbs up!
@md.akib5124
@md.akib5124 4 жыл бұрын
awesome as always
@martinv1123
@martinv1123 4 жыл бұрын
Useful as always!
@TheJonhjonhz
@TheJonhjonhz Жыл бұрын
Nice video man 🎉
@ConsuelaSpongey798
@ConsuelaSpongey798 4 жыл бұрын
Awesome vid man!
@katekatics
@katekatics 7 ай бұрын
Very helpful! Thanks a lot 🙏
@codewithfongoh
@codewithfongoh 2 жыл бұрын
Thank you for this. Great tutorial.
@tomneeld
@tomneeld 4 жыл бұрын
Nice intro. Thanks, really helped
@chandanurs7554
@chandanurs7554 4 жыл бұрын
Thanks Anthony. I am glad that i found this video. Liked and Subscribed :-)
@talanky
@talanky 2 жыл бұрын
Really helpful thanks!
@siddharthnikhil744
@siddharthnikhil744 3 жыл бұрын
Amazing video, thanks a lot!
4 жыл бұрын
Thank you very much! This took me a while I was like but I even install Linux in a partition of my drive because new celery doesn't have support for windows. Regards!
@samuelfelipecastrofernande3087
@samuelfelipecastrofernande3087 Жыл бұрын
Thank you very much!!
@MrYoklmn
@MrYoklmn 4 жыл бұрын
Finally! Finally! Thank you!
@danielkamau8436
@danielkamau8436 3 жыл бұрын
good work there
@privetabdul
@privetabdul 3 жыл бұрын
thank you!
@RealEngineer
@RealEngineer 4 жыл бұрын
Great Channel!
@rangabharath4253
@rangabharath4253 4 жыл бұрын
Awesome anthony. Could you please make a tutorial on order management system using django making use of flipkart,snapdeal,amazon seller apis. Thank you so much for the awesome tutorials.
@solo8003
@solo8003 4 жыл бұрын
Nice work, we are waiting for more like this...Thank you
@99phenomenon
@99phenomenon Жыл бұрын
full --heroku!
@yajantbhawsar2481
@yajantbhawsar2481 4 жыл бұрын
Hello Anthony, could you please make a video on, "Integrating Google calendar" in python Django, and creating the events on it. Their are not much resources or tutorials available for it. We will be so glad to have one from you. Thanks in advance.
@prettyprinted
@prettyprinted 4 жыл бұрын
That's a good idea. I'll look into it.
@deus9246
@deus9246 2 жыл бұрын
This was really helpful! Just one question how would this process of starting/restating the celery server be handled in the production environment?
@anoopkg8681
@anoopkg8681 3 жыл бұрын
For windows users, run celery as follows, celery -A projectname worker --pool=solo -l info , if you feel difficult adding redis , try RabbitMQ, download and install Erlang, RabbitmQ and add CELERY_BROKER_URL = 'amqp://localhost' in settings.py
@oops5595
@oops5595 4 жыл бұрын
Hey man, nice video but can you schedule the celery to run on particular time))) and dockerizing them would be COOOOOOOOOL AND HOT )))
@ojasio
@ojasio 4 жыл бұрын
Sweeet :). Thanku so much.
@sainco3036
@sainco3036 4 жыл бұрын
Thanks.
@tech-talks-with-ali
@tech-talks-with-ali 4 жыл бұрын
Thanks for your video, do you have more complex videos like periodic tasks ?
@igorkomarov6607
@igorkomarov6607 4 жыл бұрын
Perfect
@hemanthvatti4387
@hemanthvatti4387 3 жыл бұрын
very nice..........
@michaels8297
@michaels8297 4 жыл бұрын
Hello, could anyone explain why celery is useful over threading? On my flask app I have the user set some sensor ranges for a few different sensor values. Tried using a while loop and realized I couldnt return data to the client side since the while loop was infinite and I have since found myself looking up celery and threading. Would setting up some threads (with different variable names for each thread) be better than celery for this case?
@user-zy4mo3wp5k
@user-zy4mo3wp5k 3 жыл бұрын
A great video on Celery in Django! Thanks, Anthony :-)
@kona7805
@kona7805 4 жыл бұрын
I have a project with a Model that already had a TimeField set. Is it possible to use Celery to send a daily email based on that TimeField? Or maybe a notification in the website?
@TemirlanNurmamatov
@TemirlanNurmamatov 4 жыл бұрын
Hi, I really like your videos! Can you please make a video on Dynamic Django Formsets? I have searched the internet for a few days, and most of the solutions are out of date (5-8 years old). I think a lot of people would be interested
@phandinh1241
@phandinh1241 4 жыл бұрын
Thank for your sharing, do you know how to run a Celery worker on Google cloud?
@pravegshrestha2610
@pravegshrestha2610 3 жыл бұрын
Hi there, Here, we manually run the celery worker on the command line, but when we deploy our app on the server, then how can we run the celery worker for those tasks?
@amitborkar2892
@amitborkar2892 4 жыл бұрын
Bro should i use Django in backend for my desktop electron js application?
@michaels8297
@michaels8297 4 жыл бұрын
A point of confusion I have with this is what if there are multiple users using your website and they all are using the route with this task queue. Does each persons task get run immediately on their browser or does the task wait in the queue until its turn to execute
@MrTuzzo77
@MrTuzzo77 4 жыл бұрын
Hi, thanks for your beautiful channel. Your videos very very helpful. Can you make a video about multi thread application in Python Django? Thanks
@clintonmoshe9544
@clintonmoshe9544 4 жыл бұрын
goog content, keep it up
@susamamaity1257
@susamamaity1257 4 жыл бұрын
:even though I installed redis still it is showing:ImportError: Missing redis library (pip install redis). Please help me out. I am stuck with this.
@wesleybarnes5376
@wesleybarnes5376 3 жыл бұрын
New to this environment, so is Celery the go to for Django to do all my backend tasks and scripts basically, for example: *Running daily reports on sales, *tasks that request user reviews via automated emails, etc? Thanks for the video
@vazcaino
@vazcaino 3 жыл бұрын
Hello my friends. Great video tutorial. I have a problem here. When I have to send 1 e-mail per request it works perfectly, but if you have 5 e-mails, for example, there is a connection error with SMTP. I believe that this error is due to the competition between tasks, that is, it is trying to send everything at the same time. Is there anything that can solve this?
@pestefo
@pestefo 3 жыл бұрын
Hi, everything goes smooth until 13:00 when celery sever is run, I got this: consumer: Cannot connect to REDIS_URL: Error while reading from socket: (54, 'Connection reset by peer').. any hints where the error could be?
@byiringirooscar321
@byiringirooscar321 2 жыл бұрын
I had the same issues I don't know how we can fix this issues if you have found the fix please let me know
@pratikt007
@pratikt007 4 жыл бұрын
When i create huroku redis free so It will ask credit card information
@JaratMan
@JaratMan 3 жыл бұрын
Рахмат
@samarthgodase1011
@samarthgodase1011 3 жыл бұрын
can i schedule emails with celery to send at particular time
@lakshaynz
@lakshaynz 4 жыл бұрын
wowowowow hold up right there - how did you get a virtual environment so oquickly???????
@prota275
@prota275 2 жыл бұрын
why do you use pipenv instead of regular venv btw?
@hamedmatari2577
@hamedmatari2577 Жыл бұрын
now I can say, I understood celery
@prettyprinted
@prettyprinted 11 ай бұрын
Glad the video helped!
@tz607
@tz607 4 жыл бұрын
How to setup celery with nginx and gunicorn !??
@sohaibshafiq3962
@sohaibshafiq3962 3 жыл бұрын
Heroku Redis is not working for me. I got error saying, "Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused."
@Arturcru
@Arturcru 2 жыл бұрын
Did anyone fixed this?
@davidekong5947
@davidekong5947 Жыл бұрын
@@Arturcru At this time, you're probably not going to see Heroku Redis as part of the add-ons (you'll likely see Heroku Data for Redis). In my case, I just used another redis add-on. Try using RedisGreen.
@Arturcru
@Arturcru Жыл бұрын
@@davidekong5947 thank you i did it somehow but i will remember this in future :)
@Vickersyt
@Vickersyt 4 жыл бұрын
Hi Anthony, thanks for vid! Could you please do a tutorial on celery beat with django? For example some simple periodic web scraping with saving to db
@nehat786
@nehat786 4 жыл бұрын
This would be great brother. We need more django videos like this
@prettyprinted
@prettyprinted 4 жыл бұрын
I'll look into Celery Beat.
@Vickersyt
@Vickersyt 4 жыл бұрын
@@prettyprinted Thats great thank you so much Sir!
@amansingh-os9gd
@amansingh-os9gd 4 жыл бұрын
Hey can you please help me with an issue relating to above ? Really like your videos btw
@thezquad
@thezquad 4 жыл бұрын
Hey Antony Can you do a tutorial on celery beat with django? Maybe even the same send email task.
@prettyprinted
@prettyprinted 4 жыл бұрын
I'll look into it.
@deepanshuaggarwal7042
@deepanshuaggarwal7042 3 жыл бұрын
is it necessary to use HEROKU ?
@Furyki
@Furyki 4 жыл бұрын
redis broker is working and the task is being executed but not succeeding, though it keeps on receiving the task that it needs to execute, im using the vscode terminal and im running on windows, should i use the linux terminal in order for this to work properly ? , if you can help me then tnx in advance ur tutorial is still very helpful.
@lonterel4704
@lonterel4704 4 жыл бұрын
Same problem
@sanyammittal2943
@sanyammittal2943 4 жыл бұрын
[2020-07-16 23:52:45,251: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused. Trying again in 8.00 seconds... (4/100) getting this error whenever I run Celery server Please Help
@yokeshm5175
@yokeshm5175 3 жыл бұрын
In settings.py, instead of CELERY_BROKER_URL try using BROKER_URL
@arielmontes6404
@arielmontes6404 4 жыл бұрын
I'm geting an error when using delay() from Models. => 'NoneType' object has no attribute 'delay'
@arielmontes6404
@arielmontes6404 4 жыл бұрын
I was looking for information. Celery does not appear to guarantee compatibility with Windows in asynchronous operations.
@arielmontes6404
@arielmontes6404 4 жыл бұрын
FIXED! In the file CELERY.PY ... os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'main.settings') os.environ.setdefault('FORKED_BY_MULTIPROCESSING', '1')
@nurkanatkhametov6225
@nurkanatkhametov6225 4 жыл бұрын
Is there is issue with sending email from instance of celery on Windows? Why are you using ubuntu terminal for running celery?
@shamsow
@shamsow 4 жыл бұрын
According to the Celery docs, Windows is not supported.
@unkownknown7156
@unkownknown7156 4 жыл бұрын
@@shamsow so what can be used if not celery
@MiaElliottPhotos
@MiaElliottPhotos 4 жыл бұрын
Im building an app in which user has to provide some data and in return he/she will get an email with an attachment that contains provided data. I am expecting large traffic on my website. Would Celery make any sense in this situation?
@prettyprinted
@prettyprinted 4 жыл бұрын
Yeah, you can use Celery to handle sending the email.
@unkownknown7156
@unkownknown7156 4 жыл бұрын
Hello did you done your project as you mentioned above @Mia Elliott
@MiaElliottPhotos
@MiaElliottPhotos 4 жыл бұрын
Project was canceled and as far as I remember Celery wasn't the way to go
@sohaibshafiq3962
@sohaibshafiq3962 3 жыл бұрын
My Django application is running locally.
@abe9993
@abe9993 4 жыл бұрын
Not usefull for me because I don't want to use my credit card information for Heroku
@enes222
@enes222 3 жыл бұрын
Is it wants?
@SmoothBeatbox
@SmoothBeatbox 3 жыл бұрын
@@enes222 yes
@SmoothBeatbox
@SmoothBeatbox 3 жыл бұрын
CELERY_BROKER_URL = "redis://redis:6379" CELERY_RESULT_BACKEND = "redis://redis:6379" #add this to settings
A Quick Intro to Translation in Django (Internationalization)
11:09
Pretty Printed
Рет қаралды 46 М.
How to Create a Celery Task Progress Bar in Django
21:25
Pretty Printed
Рет қаралды 44 М.
THEY WANTED TO TAKE ALL HIS GOODIES 🍫🥤🍟😂
00:17
OKUNJATA
Рет қаралды 18 МЛН
I CAN’T BELIEVE I LOST 😱
00:46
Topper Guild
Рет қаралды 97 МЛН
1 or 2?🐄
00:12
Kan Andrey
Рет қаралды 43 МЛН
HOW DID HE WIN? 😱
00:33
Topper Guild
Рет қаралды 29 МЛН
Send emails with Django and Amazon SES
37:41
Cloud With Django
Рет қаралды 8 М.
Sending Emails in Django
8:39
Pretty Printed
Рет қаралды 82 М.
Docker - Django, Celery & Redis Docker Compose setup
20:29
Very Academy
Рет қаралды 43 М.
Learn the Basics of Django Signals
22:37
Matt Freire
Рет қаралды 49 М.
Django Contact Form | How To Send Email Using Django? | Tutorial 2022
17:31
How To Send Email With Django - Python Django Dentist Website #7
22:01
Task Queues: A Celery Story
29:39
PyCon AU
Рет қаралды 37 М.
THEY WANTED TO TAKE ALL HIS GOODIES 🍫🥤🍟😂
00:17
OKUNJATA
Рет қаралды 18 МЛН