Humphrey
Humphrey

Reputation: 4208

Synchronising data and live updates between a django webapp and desktop python app

Are there any best-practices for synchronising data between a django web-app and a desktop application? Both are in python. Ideally I'd like any data updates that happen on the webapp to be immediately pushed to the desktop app, so that the desktop app always has the latest version of the data.

Also, I want to also send some live messages between the two. Just simple stuff like "This is the item that is currently being used".

My best idea so far is to use asynchronous long polling perhaps with twisted or tornado, and use json to update the program with what has changed.

Down the track, I will also be writing equivalent android and iOS apps that will sync in a similar way.

Upvotes: 2

Views: 289

Answers (1)

Oleksiy
Oleksiy

Reputation: 6567

Not sure about best practices, but I finished something similar using django-socketio and websocket-client. This allowed for multiple web-app clients seeing push updates to data without reload. Except for some monkey patching with getting django-socketio to work with gunicorn, and only socket.io 0.6 support, it worked relatively smoothly. Also writing integration tests for the whole jig was an enormous pain, so code accordingly.

Upvotes: 1

Related Questions