I have a Django management command that I'd like to issue in an asynchronous manner (via the call_command
function). The flow of my code looks something like:
If the management command fails for some reason, I'm not too concerned (my logs will catch those cases), so allowing the user to proceed on their merry way is fine by me.
Is this kind of asynchronous call possible, and if so, how best can I do it? Is the threading
library sufficient for this case? I'm aware of packages like Celery , but using something like that seems like tremendous overkill for something as simple as what I'm trying to do.
Thats an easy one!
Just use django-rq
. Easy as a pie.
I, personally, use it for sending emails asychronously which otherwise user had to wait about 11s. Just made my life easier. Its lightweight and I love it!
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.