Re: Chrome Desktop Notification for Django

2014-11-17 Thread Collin Anderson
Hello, The frontend part is simple: var myEventSource = new EventSource('/path/to/eventsource/'); myEventSource.onmessage = function(e) { console.log(e.data) } The backend part is where things get complicated (untested code, as always :) def eventsource(request): last_id = request.META.ge

Re: Chrome Desktop Notification for Django

2014-11-13 Thread Max Nathaniel Ho
HI Collin, Thanks for pointing that out. Apart from the documentation, do you have any examples of how to implement it? Thank you. On Thu, Nov 13, 2014 at 5:55 AM, Collin Anderson wrote: > Hello, > > From a front-end standpoint, I personally like EventSource for this, > though you could also u

Re: Chrome Desktop Notification for Django

2014-11-12 Thread Collin Anderson
Hello, >From a front-end standpoint, I personally like EventSource for this, though you could also use websockets or polling (checking every few minutes/seconds). https://developer.mozilla.org/en-US/docs/Web/API/EventSource http://en.wikipedia.org/wiki/Server-sent_events Collin On Tuesday, No

Chrome Desktop Notification for Django

2014-11-11 Thread Max Nathaniel Ho
I found this excellent example on Chrome Desktop Notification - Chrome desktop notification example? I am able to create the Desktop Notification by clicking a button. However, that is pretty front-end. I woul