Django determine if client hasn't made a request in X seconds
You can try using Django's cache mechanism (either memcached or redis) to store the timestamp of the last communication for a given Android App Client with its ID as cache key and an expiration time of whatever you want the timeout to be.
Setting it up like this you are able to simply check if the cache has a record of the current Android App's ID to determine if it errored out.
I have an android app sending requests to a Django back-end asking whether it should perform a certain operation. These act as heartbeats. There is a client-side page that will allow the user to tell the android app to perform those operations. However, I would like to be able to tell the client-side page, whether the phone app has died for some unexpected reason, or has stopped sending the server heartbeats.
Is there a way in Django to add a timer to a view such that a signal will be triggered if the client doesn't send a request after X seconds? Is there a Android Websockets library for Django that would do this better?