Please enable JavaScript.
Coggle requires JavaScript to display documents.
Django - Coggle Diagram
Django
Signals
Where/why they are used ???
Example profile updates when user saved
How to use ?
Setting the receiver using
.connect
Decorators
Signals.py
Also have to override the ready method in App.config
and in settings.py INSTALLED APPS app_name.apps.BaseConfig
Otherwise
Create functions and attach receivers to them
Types of signals
Note that you have to register receivers
Also note that the order in which the receivers are registered determines the order in which they receive a signal
How to register? Signal.connect
When a signal send then all its receiver function is called in the order they were registered
Views
decorators
import from django.views.decorators
they are functions
called using
name_decorartor
and before a function defination
Doubts
exact synatx
any other way of using decorartors
necessary to place just above the function def line ???
Can we use several decorators
I dont know probably not
if yes synatx