I have a python script that open and mantein a websocket (socket.io) with a remote server and a django instance. For my purpose I want the script to start and stop with the django server. I would also like to exchange data between the two.
In praticular django needs to be notified whenever the remote server goes offline and keep this information globally.
The tricky points for me are:
- Start and stop django and the script at the same time.
- Store globally the state of the script in the django application
Is there a good way to implement this?