简体   繁体   中英

How to receive Django post_save signal on AJAX query?

I use AJAX request to create an order, also I have a post_save signal that should be executed after the order will save. Whether is it possible to receive this post_save signal on an AJAX request?.. because I don't get aything, the signal handler is ignored =|

1. Okay. After I have read whole documentation of signals in depth I didn't find anything that helped me to solve the prolem. Then I have read this post that describe the signals at great length. So, I forget to add the default_app_config in the __init__.py of my module:

default_app_config = 'cmdbox.profiles.apps.ProfilesConfig'

Hope this hint will help someone like me)

2. The answer for the main question, thanks to the Daniel Roseman :

If you have a post-save signal, it is always sent on save. It has nothing to do with whether the original request is Ajax or not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM