Is there any way to make an asynchronous function call from Python [Django]?

前端 未结 4 404
余生分开走
余生分开走 2020-12-16 05:17

I am creating a Django application that does various long computations with uploaded files. I don\'t want to make the user wait for the file to be handled - I just want to s

4条回答
  •  Happy的楠姐
    2020-12-16 06:13

    I have tried to do the same and failed after multiple attempt due of the nature of django and other asynchronous call.

    The solution I have come up which could be a bit over the top for you is to have another asynchronous server in the background processing messages queues from the web request and throwing some chunked javascript which get parsed directly from the browser in an asynchronous way (ie: ajax).

    Everything is made transparent for the end user via mod_proxy setting.

提交回复
热议问题