2👍
You can use http and websockets like @avril-lavigne said but for me best way to use Message queue (MQ) for example https://redis.io
since it has pub\sub implememtation or maybe best for you zeromq.
- Easiest way: Send list of items to nodeJs server from the web
page, process data and send result to webserver using
websockets/long polling or just hit server everyn
second while
data not ready and send back to user same way. - Good way(for me) make api by Node js, communicate with nodeJs by
RestApi(idea exactly like in 3th approach by use http). -
Hard way: In django you need create a task(your items with
uniq id to indentify) to put the task to any storage (redis, your
DB), send that task_id to web_page.In that time in nodeJs make a waiter which will wait for the task,
process the data and put to storage.So you have task_id in browser client and ready data in storage. Now
doing exactly same like in step 1 – hit every n second/* server to
check if the task is complicated.
Source:stackexchange.com