Server-Sent Events for Django

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Server-Sent Events for Django

justin-3
Hi folks,

I'm pleased to announce an SSE library for Django:

The library makes pushing data from the server really easy. It uses Channels under the hood, although you don't have to write any async code. Simply declare endpoints in routing.py and call send_event() from anywhere.

I hope others find it useful.

Justin

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKFnGOQ4-s6xOSWfthEiddpKRYgMYs4y15V_XRn1SOBvz_SZqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Server-Sent Events for Django

Jason-6
Nice library!  good work :-)

I would suggest you update your readme to reflect that SSE is not supported by any MS browser (IE or Edge) as shown by https://caniuse.com/#feat=eventsource.  

On Wednesday, June 13, 2018 at 7:34:21 PM UTC-4, Justin Karneges wrote:
Hi folks,

I'm pleased to announce an SSE library for Django:
<a href="https://github.com/fanout/django-eventstream" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Ffanout%2Fdjango-eventstream\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH3CVxiigQK6p0cvcSsoWkTxc1Uyg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Ffanout%2Fdjango-eventstream\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH3CVxiigQK6p0cvcSsoWkTxc1Uyg&#39;;return true;">https://github.com/fanout/django-eventstream

The library makes pushing data from the server really easy. It uses Channels under the hood, although you don't have to write any async code. Simply declare endpoints in routing.py and call send_event() from anywhere.

I hope others find it useful.

Justin

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4663cbf8-ff53-4fef-973b-ba26f09acd42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Server-Sent Events for Django

justin-3
Thanks Jason! The library comes with Yaffle's polyfill for IE/Edge support, that can be included with a template tag.


On Wed, Jun 13, 2018 at 5:20 PM, Jason <[hidden email]> wrote:
Nice library!  good work :-)

I would suggest you update your readme to reflect that SSE is not supported by any MS browser (IE or Edge) as shown by https://caniuse.com/#feat=eventsource.  


On Wednesday, June 13, 2018 at 7:34:21 PM UTC-4, Justin Karneges wrote:
Hi folks,

I'm pleased to announce an SSE library for Django:

The library makes pushing data from the server really easy. It uses Channels under the hood, although you don't have to write any async code. Simply declare endpoints in routing.py and call send_event() from anywhere.

I hope others find it useful.

Justin

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKFnGOQbaWJ_NbNYRzWAryN3pwZqmmr8Z16R24eqRjsWUsasHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Server-Sent Events for Django

Jason-6
ooh, nice!  missed that part.

Did you consider having that pull from a CDN rather than locally?  Reason being, any updates to said polyfills will require you to deploy an update.  Whereas if you have a template tag to pull from a CDN, you can have your users specify the version if necessary and pull the latest by default.  Would be one less thing you have to worry about maintaining.  


Also, what's the reason for having json2 in the static files?  https://github.com/douglascrockford/JSON-js even states

On current browsers, this file does nothing, preferring the built-in JSON object. There is no reason to use this file unless fate compels you to support IE8, which is something that no one should ever have to do again.

Other than that, the lib looks pretty good to me.  </thumbs-up>
 
On Wednesday, June 13, 2018 at 9:20:44 PM UTC-4, Justin Karneges wrote:
Thanks Jason! The library comes with Yaffle's polyfill for IE/Edge support, that can be included with a template tag.

<a href="https://github.com/fanout/django-eventstream#receiving-in-the-browser" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Ffanout%2Fdjango-eventstream%23receiving-in-the-browser\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHov1T-H-JoxNMMM4IvHRXOYGwJgA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Ffanout%2Fdjango-eventstream%23receiving-in-the-browser\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHov1T-H-JoxNMMM4IvHRXOYGwJgA&#39;;return true;">https://github.com/fanout/django-eventstream#receiving-in-the-browser

On Wed, Jun 13, 2018 at 5:20 PM, Jason <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="NQaAjb_WBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jjohn...@...> wrote:
Nice library!  good work :-)

I would suggest you update your readme to reflect that SSE is not supported by any MS browser (IE or Edge) as shown by <a href="https://caniuse.com/#feat=eventsource" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fcaniuse.com%2F%23feat%3Deventsource\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHW8R-Y9ttTjU5LEcVvF0mvkvibFA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fcaniuse.com%2F%23feat%3Deventsource\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHW8R-Y9ttTjU5LEcVvF0mvkvibFA&#39;;return true;">https://caniuse.com/#feat=eventsource.  


On Wednesday, June 13, 2018 at 7:34:21 PM UTC-4, Justin Karneges wrote:
Hi folks,

I'm pleased to announce an SSE library for Django:
<a href="https://github.com/fanout/django-eventstream" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Ffanout%2Fdjango-eventstream\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH3CVxiigQK6p0cvcSsoWkTxc1Uyg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Ffanout%2Fdjango-eventstream\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH3CVxiigQK6p0cvcSsoWkTxc1Uyg&#39;;return true;">https://github.com/fanout/django-eventstream

The library makes pushing data from the server really easy. It uses Channels under the hood, although you don't have to write any async code. Simply declare endpoints in routing.py and call send_event() from anywhere.

I hope others find it useful.

Justin

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/dfe6f4ad-006d-422f-8911-1cbab60f038e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Server-Sent Events for Django

justin-3
Thanks for the tips.

I didn't think about referencing a CDN, but I suppose that's a better default, and if people want local copies then they can make their own.

Json2 probably shouldn't be in there. I've been dragging that file around for years without really thinking about it. If anyone really needs to support old IE they should know to include it themselves.

Justin

On Wed, Jun 13, 2018 at 7:45 PM, Jason <[hidden email]> wrote:
ooh, nice!  missed that part.

Did you consider having that pull from a CDN rather than locally?  Reason being, any updates to said polyfills will require you to deploy an update.  Whereas if you have a template tag to pull from a CDN, you can have your users specify the version if necessary and pull the latest by default.  Would be one less thing you have to worry about maintaining.  


Also, what's the reason for having json2 in the static files?  https://github.com/douglascrockford/JSON-js even states

On current browsers, this file does nothing, preferring the built-in JSON object. There is no reason to use this file unless fate compels you to support IE8, which is something that no one should ever have to do again.

Other than that, the lib looks pretty good to me.  </thumbs-up>
 
On Wednesday, June 13, 2018 at 9:20:44 PM UTC-4, Justin Karneges wrote:
Thanks Jason! The library comes with Yaffle's polyfill for IE/Edge support, that can be included with a template tag.


On Wed, Jun 13, 2018 at 5:20 PM, Jason <[hidden email]> wrote:
Nice library!  good work :-)

I would suggest you update your readme to reflect that SSE is not supported by any MS browser (IE or Edge) as shown by https://caniuse.com/#feat=eventsource.  


On Wednesday, June 13, 2018 at 7:34:21 PM UTC-4, Justin Karneges wrote:
Hi folks,

I'm pleased to announce an SSE library for Django:

The library makes pushing data from the server really easy. It uses Channels under the hood, although you don't have to write any async code. Simply declare endpoints in routing.py and call send_event() from anywhere.

I hope others find it useful.

Justin

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKFnGOTs0uCjsCAd_PzKFcF8WLHitWYmHHnd6TeigU8Mf9pcPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.