I have used django_mysql.locks to acquire a lock. This implements the user level locking functions in MySQL This works for the first user. The lock is acquired and held by the first user. On Pythonanywhere a second user logging on from a separate device is able to release this lock using the release lock method.
On my localhost version of the app the second user is not able to release the lock acquired by the first user - it only happens when I deploy the app to Pythonanywhere.
I have reviewed the metadata_locks table in the Performance schema on my local host and I can see the first and second users have different connection id's. I do not have access the Performance Schema on Pythonanywhere.
From the debug code that I have looked at it appears that in Pythonanywhere the connection id for both the first and second user is the same. I used lock.holding_connection_id() to obtain the connection id. If the two users have the same connection id then the lock is not user specific.
It appears that I cannot use django_mysql.locks on Pythonanywhere. Is there something I am missing.