gmv
gmv

Reputation: 209

Displaying messages through django signals

I'm looking to make a django app that uses signals. (using django signals) There I would like to run some functions, and based on which output they give, send a message within the webpage. so for example, if the function fails i want to send a message saying it failed.

this is pretty much want i would want

in signals.py -----
def handle_event(request, *args, **kwargs):
    try: 
    --unimportant--
    except: 
       messages.error(request, 'error message') 
post_save.connect(handle_event, sender=Event)

how would i go about doing this?

Upvotes: 0

Views: 351

Answers (0)

Related Questions