1

I'm using tastypie + django + backbone.js . My application should be usable by more than one user at a time.

What I want to do is to show all users "live" changes on the database without having the users manually reloading the page.

Anyone around to point me in the right direction?

Thanks

Henrik Andersson
  • 45,354
  • 16
  • 98
  • 92
jbos1234
  • 93
  • 1
  • 7
  • Search for "javascript timer" and you should find something. – Some programmer dude May 24 '13 at 10:28
  • 1
    See http://en.wikipedia.org/wiki/Push_technology for a variety of options and also http://stackoverflow.com/questions/4787530/does-django-have-a-way-to-open-a-http-long-poll-connection – Pramod May 24 '13 at 11:49

1 Answers1

0

To get this working in all major browsers you will have to periodically send an AJAX request to your server asking if any changes have occured. In modern browsers you could make use ob web sockets to setup a PUSH service where the server can push those changes to your application or simply notify you about it.

(If you are using Backbone as an MVC framework anyway you might as well step back from the idea of reloading the page and just request your data using AJAX and use Backbone's View component to render your data into HTML elements)

Leo Selig
  • 1,062
  • 1
  • 16
  • 30