I have a webservice in django that I need to serve requests as fast as I can do.
Every request updates an object. I also save request ip address for populating geographic information later.
Getting geographic information is accomplished by external service provider. I give them ip address and get geographic information.
So I want to serve user request as fast as I can and populate geographic information soon after creation/update. (after 1-2 sec)
So I need a handler, that is called 1-2 secs after responding request. And it should have the updated-or-created object as argument.
I guess it is not post_save, but I couldnt find the correct way.
Which is the best way to achieve this?
Thanks
So the task is to move work out of request-response cycle. You’re correct that django’s signals have nothing to do with this. You may try celery for your task, it seems to be the most mature and widely used way to move work out of request-response cycle for django.