I was asking myself if there is a simple way of defining a callback method when defining a DRF endpoint.
For example, let's say I want to reproduce this workflow:
- app1 sends data to app2, calling a DRF endpoint living in app2
- app2 immediately sends the HTTP 200/201 response to app1
- app2 makes a "heavy" work then.
Of course, I'm aware there are cleaner alternative:
- I know heavy work loads should live in a Celery task, or Django channel
- I know it would make more sense in my case that app2 is the one that makes the request, and app1 sends the response.
I found ideas here but it's very related to Django itself, not Django Rest Framework.