I made a little app to act as a browser using requests, that makes use of library's capabilities to handle sessions and pass the CSRF tokens to Django properly.
There are mulitple apps of this connecting to the server, where authentication and sessions need to be handled, and this is done.
I need to have the client permanently connected to the Django server side, and I think this could be handled by setting the session only expires when the client closes or disconnects.
The other thing I want to do is to make django start sending data based on some events on the server making use of the open sessions with the authenticated and logged in clients, how can I do this?
Keeping in mind that the function that will take care of the events on the server and correspondingly sending some message/data to the client is not the view function, where return HttpResponse
can be utilized; even though, HttpResponse can only send the response once per request not per some event that might be repeated, hence multiple responses could be sent.