Maybe you can do that with "XEP-0070: Verifying #HTTP Requests via #XMPP" https://xmpp.org/extensions/xep-0070.html
There are some blog posts about it here: https://blog.agayon.be/tag/xep-0070.html
It has a #Django demo site, too, but it seems to be broken right now.