1 year ago

#256357

test-img

gmv

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?

python

django

django-signals

django-messages

django-request

0 Answers

Your Answer

Accepted video resources