But how do DJANGO signals work?

  Рет қаралды 41,994

CodingEntrepreneurs

CodingEntrepreneurs

Күн бұрын

Learn the fundamentals behind Django signals in this one.
Code: github.com/codingforentrepren...
Ref: docs.djangoproject.com/en/3.1...
Time & Tasks 2 Project: cfe.sh/projects/time-tasks-2
Have a question? Let me know in the comments.
Do you like my hat? Grab one for 20% off here: kirr.co/e8yybv (not sponsored)
0:00:00 Welcome
0:01:33 Examples of Model Instance Events
0:04:48 User created pre_save & post_save
0:15:50 Practical Example with Custom Model
0:23:40 pre_delete & post_delete
0:26:53 Bonus
0:35:15 Thank you

Пікірлер: 78
@divakaryadav2265
@divakaryadav2265 3 жыл бұрын
4 years ago I got into IT because of you and surprised to see such less subscribers. you deserve a lot more.
@CodingEntrepreneurs
@CodingEntrepreneurs 3 жыл бұрын
Thank you but hearing you got into IT because of my videos is worth 100mil subs.
@niyasmohammed046
@niyasmohammed046 2 ай бұрын
Hi DIvakaryadav shall we connect on LinkedIn?
@concrete4054
@concrete4054 3 жыл бұрын
Would be cool, if you could go deeper into how to structuring larger applications in a sailable and maintanable way. Including folder structure, business logic, validation... There are a lot of beginner tutorials. But it is much harder to find advanced tutorials.
@jesseinit
@jesseinit 3 жыл бұрын
I really second this. Everywhere you go to is a bunch of beginner vidoes...We could use a bit more complexity right now
@sarveshyadav01
@sarveshyadav01 3 жыл бұрын
yeah man actually needed!
@alexy.3512
@alexy.3512 3 жыл бұрын
Two Scoops of Django 3.x
@JA-ur8ob
@JA-ur8ob Жыл бұрын
As this post is 2 years old, keen to know 2 things: 1- Did you guys get a decent job or create a decent website that scaled well? 2- Maybe you can now answer your own question for me? I've been working on a large django project for 8 months and now have to make a massive database change because of a database design flaw. It'd be good to hault my progress and learn scalability concepts before I continue to prevent this from happening again. Thanks
@codegeek8256
@codegeek8256 3 жыл бұрын
This is a very good tutorial, i would suggest you make it a series whereby you cover this kind of Django specialized concepts that are not usually covered in general tutorials. You pick them same as you picked signals and focus only on them per video. it would have been nice if you also cover m2m signals. Thank you.
@fathiabdelmalek6203
@fathiabdelmalek6203 3 жыл бұрын
Thanks. Thank you a lot. Thank you so mush. I have searched for two weeks for that, and finally find it and understand it. Thank you
@ahmed_mokhtar486
@ahmed_mokhtar486 10 ай бұрын
Your explanation is very clear and straightforward to understand the logic. Thanks
@rafafi7213
@rafafi7213 Жыл бұрын
Thank you for the help understanding signals! helped me out a lot. caught you slipping there tho at 17:02.
@TimePasser
@TimePasser 3 жыл бұрын
You are amazing. Thank you very much for the effort of teaching in very simplified way. Iam learning a lot from you. Thank you.
@pawankushwah4992
@pawankushwah4992 2 жыл бұрын
Very good and simple explanation.
@brhh
@brhh 3 жыл бұрын
I would like to see a deep dive into Channels because there seems to be little to no in depth explainations with the same way you present the details which is so unique and understandable
@shaxzod6485
@shaxzod6485 3 жыл бұрын
Thank you bro for the amazing content)
@dikimuhamadsyidik9650
@dikimuhamadsyidik9650 3 жыл бұрын
Thankyou justin this is helpful
@bobtanner5151
@bobtanner5151 3 жыл бұрын
Deep drive into full stack testing. Testing views, models, forms, etc.
@salmanmammadli
@salmanmammadli 3 ай бұрын
Thank you very much man.
@ellawhitestone
@ellawhitestone 3 жыл бұрын
Thanks my dear brother... Very good examplez
@hellosingh4408
@hellosingh4408 3 жыл бұрын
Very helpful video
@user-si3yb1ps3i
@user-si3yb1ps3i 2 жыл бұрын
thx very much for subtitles
@kwakukarikari8095
@kwakukarikari8095 3 жыл бұрын
Very good explanation.
@youssefel-shabasy833
@youssefel-shabasy833 2 жыл бұрын
great tutorial, keep it going :D
@khalednur9229
@khalednur9229 3 жыл бұрын
thanks for sharing this idea. you help me a lot!!!!
@joy_sam_raj
@joy_sam_raj Жыл бұрын
Thanks a lot.. Well clear explanation
@mhmmdmustafayev8216
@mhmmdmustafayev8216 2 жыл бұрын
best explaination
@tomaszscierski7351
@tomaszscierski7351 3 жыл бұрын
Great job, thank you
@JoseLuisMorales
@JoseLuisMorales 11 ай бұрын
Best signals introduce for beginners ever 🎉😊
@idrisrampurawala
@idrisrampurawala 3 жыл бұрын
Nice tutorial as always 😉 Thanks for sharing. I have one query regarding usage of signals in a distributed environment. Let's say we are running django in multiple processes via docker or something and these signals are run inside the same process in which the model was created. So how to handle scenarios for failover. Like if the process got crashed without executing let's say the post save signal. And when it restarts, the signal is lost but model got saved. Any ideas on these scenarios?
@MainulHoqueHira28
@MainulHoqueHira28 3 жыл бұрын
awesome video
@tajbinkhan4858
@tajbinkhan4858 3 жыл бұрын
Hi sir, Big fan of you and your tutorial. I have a request on Django framework. I have searched KZbin and google about booking system with Django. But I did not get proper instruction how to do that. If you upload tutorial about that, it will be very grateful. Thank you, sir. 🥰🥰🥰
@Morteza7220
@Morteza7220 Жыл бұрын
thanks
@johnathanjames2872
@johnathanjames2872 8 ай бұрын
About adding slugs to an instance, doesn't using signals seems a little bit overkill, I mean I'm always overriding the save() method in the Model, check if there's a slug on the instance, if not, slugify the title, add it as an attribute to the instance and call the super save
@Techiesse
@Techiesse 3 жыл бұрын
I understood how to use signals. That was a great explanation. Thank you. I'd like to place a practical question, if I may: I don't see why I would implement the behaviours on BlogPost using signals. Why not override the save method (for instance) on the model itself? It seems to me a much cleaner workflow for the example you presented. By overriding the method I'd have all the class related behaviour in one place under the umbrella of the class itself. I can see the utility for signals when dealing with a layered architecture and I don't want to inject code of a higher layer into a lower layer (which shouldn't know anything about its clients). The first example, triggering actions based on User creation, matches perfectly this scenario. I know your intention is to bring a didactical example to showcase the signals. I'm just elaborating on this on my side. Congrats for the great content!
@CodingEntrepreneurs
@CodingEntrepreneurs 3 жыл бұрын
Thanks. Here are my thoughts on this exactly : www.codingforentrepreneurs.com/blog/post-save-vs-pre-save-vs-override-save-method
@CodingEntrepreneurs
@CodingEntrepreneurs 3 жыл бұрын
I haven’t changed my view on this either :)
@CodingEntrepreneurs
@CodingEntrepreneurs 3 жыл бұрын
And the official docs: docs.djangoproject.com/en/3.1/topics/db/models/
@Techiesse
@Techiesse 3 жыл бұрын
@@CodingEntrepreneurs Hi, thanks for replying. I read your blog post. I think the example you mention there is similar (you provide handlers for a class defined in another file) to the User example you use in the video, which for me is ok. What is making me think is the Blogpost model. In this case I'm trying to figure out what makes more sense.
@JoseNavas
@JoseNavas 3 жыл бұрын
Thanks for the tutorial. Any chance you update your DRF course on Udemy?
@onlinetimenow1647
@onlinetimenow1647 3 жыл бұрын
what's the best way to implement dependant drop-down chained field in a django form(like: country->city and category->subcategory) retrieving data from db. i personally have difficulty to get the response back and populate the field(although i followed some examples but not happening). thank
@dilipsai909
@dilipsai909 3 жыл бұрын
did you try smart_select library?it has a chainedfield functionality
@csandreas1
@csandreas1 3 жыл бұрын
Please make a video about business logic in django. Some people believe that business logic should be in the Models
@LucienDadaKYABU
@LucienDadaKYABU 2 жыл бұрын
Great Tutorial! Helped me achieve some King of business logic in an Invoice and Stock Management System. But How To notify user in a django template in realtime like maybe the user x has been deleted or Added ?
@CodingEntrepreneurs
@CodingEntrepreneurs 2 жыл бұрын
Make a notifications app with models for the user
@CodingEntrepreneurs
@CodingEntrepreneurs 2 жыл бұрын
There’s a third party one called Django-notify I believe
@usamahussain4461
@usamahussain4461 11 ай бұрын
got question. Instance is not given an ID until you save it. But how is the condition working in blog_post_pre_save() model?
@grandlibulu3701
@grandlibulu3701 2 жыл бұрын
Can you cover Signals for foreignkeyfield
@shivamdubey4783
@shivamdubey4783 Жыл бұрын
can we use django signals to send notifications also
@mohammedfareedh
@mohammedfareedh 3 жыл бұрын
So Justin Bro, This acts like a trigger that is used in relational SQL tables servers like Mysql, PostgreSQL and etc
@bhutanpythoncoder
@bhutanpythoncoder 3 жыл бұрын
Thank you for the great content. Will django signal works if i have to give access to students which was registered by teacher in school management system. Haven't seen tutorials taking about this. I would be very grateful if you give some idea. Thank you 🙏🙏🙏🙏
@CodingEntrepreneurs
@CodingEntrepreneurs 3 жыл бұрын
The Signals I used based on models, not users. So you can use it for what you’ve said. Why not experiment on your own?!
@bhutanpythoncoder
@bhutanpythoncoder 3 жыл бұрын
@@CodingEntrepreneurs Thank you so much sir. I learn a lot from your channel. May you reach million subscriber ASAP.
@nextgodlevel4056
@nextgodlevel4056 3 жыл бұрын
he is not a teacher, he is more than a teacher the way he teaches is awesome
@ajinzrathod
@ajinzrathod 3 жыл бұрын
21:25 Would be good if you included that video link in description. Couldn't find it.
@CodingEntrepreneurs
@CodingEntrepreneurs 3 жыл бұрын
You're right. It's here cfe.sh/projects/time-tasks-2 Thank you
@ajinzrathod
@ajinzrathod 3 жыл бұрын
@@CodingEntrepreneurs Thank you so much ♥♥♥♥
@litDevYT
@litDevYT 3 жыл бұрын
Never dissappoints like always
@ceswest1223
@ceswest1223 3 жыл бұрын
how can I implement django signals in docker?
@tinoutech5016
@tinoutech5016 Жыл бұрын
Why signals work only when we put them in the models.py file?
@ajinzrathod
@ajinzrathod 3 жыл бұрын
25:22 He says, "actually that doesn't cover all types of delete". That means that when you delete multiple objects(using multiple checkboxes in django admin), def delete () would not work there. It only works on single object. Hope this clears someone doubt.
@poonamyadav7552
@poonamyadav7552 3 жыл бұрын
Is this same process,if our project is live
@baldeagle6531
@baldeagle6531 3 жыл бұрын
Please help me, signal m2m_changed post_remove does not work for me
@deepbhut1922
@deepbhut1922 2 жыл бұрын
hey.. sir is it work django with mysql database
@poonamyadav7552
@poonamyadav7552 3 жыл бұрын
Is this same process,if our project is live
@hiromsantosh4215
@hiromsantosh4215 3 жыл бұрын
Is server side rendering possible with django, if then plz do a tutorial :)
@brhh
@brhh 3 жыл бұрын
I believe django already uses server side rendering for the templates, they are giving them raw
@LifeIsCrazyAsShit
@LifeIsCrazyAsShit 3 ай бұрын
Here is some challenge i guess How to pass additional data to the signal For example we have default user model and while user registration we are also asking for some additional data like phone number, DOB, etc ..these additional data needed to pass to the signal
@Brother_rafael356
@Brother_rafael356 Ай бұрын
im still confused as a first timer learning django but im less confused compared to 45 minutes ago thanks
@sachinjadhav8252
@sachinjadhav8252 3 жыл бұрын
Why Python Ecommerce.com site not working?
@ashrf8050
@ashrf8050 11 ай бұрын
🥰
@dhavalsavalia
@dhavalsavalia 3 жыл бұрын
NSFW warning at 17:00 xD
@shivampratap8259
@shivampratap8259 3 жыл бұрын
i literally came down to type that thing XD
@jasonk4614
@jasonk4614 Жыл бұрын
17:02 :)
@aksjin8929
@aksjin8929 3 жыл бұрын
.
@neildutoit5177
@neildutoit5177 Жыл бұрын
Video title: "But how do DJANGO signals work?" Video: "Here's how to use Django signals" Nice clickbait.
@saeedmhmoud109
@saeedmhmoud109 3 жыл бұрын
Translate for Arabic please
Django Interview Questions (Junior Developer)
30:26
Dennis Ivy
Рет қаралды 120 М.
Django signals for beginners | How to use signals in Django
54:32
- А что в креме? - Это кАкАооо! #КондитерДети
00:24
Телеканал ПЯТНИЦА
Рет қаралды 7 МЛН
Custom Django User Model // DJANGO Tutorial
1:04:40
CodingEntrepreneurs
Рет қаралды 155 М.
Уроки по Wagtail 24 | Добавление Джанго сигналов (Django signals)
16:25
Видеоуроки по программам для научных исследований
Рет қаралды 6 М.
Learn the Basics of Django Signals
22:37
Matt Freire
Рет қаралды 49 М.
Django Channels & WebSockets Oversimplified
16:35
Dennis Ivy
Рет қаралды 128 М.
WebSocket + Django + Vue
57:24
Django School | Омельченко Михаил
Рет қаралды 30 М.
Understanding Django Model Relationships
25:56
Pretty Printed
Рет қаралды 94 М.
These Coding Projects Give You An Unfair Advantage
14:39
Harkirat Singh
Рет қаралды 337 М.
🚀  TDD, Where Did It All Go Wrong (Ian Cooper)
1:03:55
DevTernity Conference
Рет қаралды 554 М.
Microservices using SpringBoot | Full Example
1:21:39
Daily Code Buffer
Рет қаралды 1 МЛН
- А что в креме? - Это кАкАооо! #КондитерДети
00:24
Телеканал ПЯТНИЦА
Рет қаралды 7 МЛН