Re: Feature: Template Components

2015-05-31 Thread Joe Tennies
I actually think this is a great idea. In my mind it parallels Drupal's "block" idea. (This is actually what I keep hoping DjangoCMS is.) That stated, it is more of a construct. I think a great idea is to make an extension module. I don't know how long you've been in this community, but Django

Re: Feature: Support Server-Sent Events

2015-05-31 Thread Curtis Maloney
I think the real questions are: 1. What is stopping a 3rd party product from providing the features you want? If there is something Django can do to make it easier, point it out, and I'll gladly champion a good feature. 2. Why should your solution be the "blessed" solution? The discussion

Re: Feature: Support a javascript template language on the server

2015-05-31 Thread Emil Stenström
On Sunday, 31 May 2015 18:49:07 UTC+2, Enrique Paredes wrote: > > IMHO, this can be easily solved with nunjucks.js and jinja which are both > interchangeable, but in my experience it's better to had 2 template > languages. Using only one tpl gives you the need to implement the same in > the

Re: Feature: Support Server-Sent Events

2015-05-31 Thread Emil Stenström
On Sunday, 31 May 2015 15:56:09 UTC+2, Florian Apolloner wrote: > > On Saturday, May 30, 2015 at 10:40:26 PM UTC+1, Emil Stenström wrote: >> >> Client A clicks a button on the site, that sends an normal ajax request >> to Django. In the view a message is passed from Django to the SSE process. >>

Re: Feature: Support Server-Sent Events

2015-05-31 Thread Emil Stenström
On Sunday, 31 May 2015 16:52:50 UTC+2, Rotund wrote: > > The fact that you keep describing your idea as another process/thread that > has back and forth communication with the actual Django instance seems to > indicate to me that it's another program. > Yes, I was not clear about the

Re: Feature: Support a javascript template language on the server

2015-05-31 Thread Enrique Paredes
IMHO, this can be easily solved with nunjucks.js and jinja which are both interchangeable, but in my experience it's better to had 2 template languages.  Using only one tpl gives you the need to implement the same in the django views than in the js controller wich is "harsh" coupled and a PITA.

Re: Feature: Support Server-Sent Events

2015-05-31 Thread Joe Tennies
I'm going to kind of reiterate what Florian said. The fact that you keep describing your idea as another process/thread that has back and forth communication with the actual Django instance seems to indicate to me that it's another program. I think people here tend to follow more of the UNIX

Re: Feature: Support Server-Sent Events

2015-05-31 Thread Florian Apolloner
On Saturday, May 30, 2015 at 10:40:26 PM UTC+1, Emil Stenström wrote: > > Client A clicks a button on the site, that sends an normal ajax request to > Django. In the view a message is passed from Django to the SSE process. > How, you still need some kind of interprocess communication So the

Re: Feature: Template Components

2015-05-31 Thread Emil Stenström
On Sunday, 31 May 2015 11:36:51 UTC+2, riccardo.magliocchetti wrote: > > Il 31/05/2015 11:00, Emil Stenström ha scritto: > > On Sunday, 31 May 2015 10:27:24 UTC+2, riccardo.magliocchetti wrote: > > Il 30/05/2015 18:52, Emil Stenström ha scritto: > > But your proposal keeps html and js

Re: Feature: Support Server-Sent Events

2015-05-31 Thread Emil Stenström
On Sunday, 31 May 2015 11:16:17 UTC+2, Javier Guerra wrote: > > On Sun, May 31, 2015 at 3:52 AM, Emil Stenström > wrote: > > Could you help me understand why this have to be done inside a web > server > > container? > > AFAICT, it doesn't have to be done in the container, but

Re: Feature: Support Server-Sent Events

2015-05-31 Thread Emil Stenström
On Sunday, 31 May 2015 11:15:28 UTC+2, Federico Capoano wrote: > > On Sunday, May 31, 2015 at 10:52:26 AM UTC+2, Emil Stenström wrote: > ... > >> Also, I don't think you would need to mix redis (or any other persistent >> storage) into this. The connected clients could simply be stored in an >>

Re: Feature: Template Components

2015-05-31 Thread Riccardo Magliocchetti
Hi Emil, Il 31/05/2015 11:00, Emil Stenström ha scritto: Hi, On Sunday, 31 May 2015 10:27:24 UTC+2, riccardo.magliocchetti wrote: Hi, Il 30/05/2015 18:52, Emil Stenström ha scritto: But your proposal keeps html and js separated. I think you are solving a problem for the

Re: Feature: Support Server-Sent Events

2015-05-31 Thread Javier Guerra Giraldez
On Sun, May 31, 2015 at 3:52 AM, Emil Stenström wrote: > Could you help me understand why this have to be done inside a web server > container? AFAICT, it doesn't have to be done in the container, but currently it must be 'outside' of Django. But having help from the container

Re: Feature: Support Server-Sent Events

2015-05-31 Thread Federico Capoano
Hey Emil, On Sunday, May 31, 2015 at 10:52:26 AM UTC+2, Emil Stenström wrote: ... > Also, I don't think you would need to mix redis (or any other persistent > storage) into this. The connected clients could simply be stored in an > in-memory array, that is discarded if the server crashes.

Re: Feature: Template Components

2015-05-31 Thread Emil Stenström
Hi, On Sunday, 31 May 2015 10:27:24 UTC+2, riccardo.magliocchetti wrote: > > Hi, > > Il 30/05/2015 18:52, Emil Stenström ha scritto: > > Hi, > > > > This is the first feature proposal as part of my general drive for > getting > > Django to work better for javascript heavy sites. > > This

Re: Feature: Support Server-Sent Events

2015-05-31 Thread Emil Stenström
Could you help me understand why this have to be done inside a web server container? When I've previously read about reasons for that they tend to be things like "handling slow clients", something that an event loop is excellent at automatically. To me, this means that this process could run

Re: Feature: Template Components

2015-05-31 Thread Riccardo Magliocchetti
Hi, Il 30/05/2015 18:52, Emil Stenström ha scritto: Hi, This is the first feature proposal as part of my general drive for getting Django to work better for javascript heavy sites. This is a bold premise :) Template Components --- React.js popularized the notion that in

Re: Feature: Support Server-Sent Events

2015-05-31 Thread Roberto De Ioris
> On Sun, May 31, 2015 at 1:23 AM, Roberto De Ioris > wrote: >> I obviously agree, but take in account that this uWSGI plugin simplified >> the steps a lot: >> >> https://github.com/unbit/uwsgi-sse-offload > > > nice. it certainly looks cleaner than having an external gevent >

Re: Feature: Support Server-Sent Events

2015-05-31 Thread Javier Guerra Giraldez
On Sun, May 31, 2015 at 1:23 AM, Roberto De Ioris wrote: > I obviously agree, but take in account that this uWSGI plugin simplified > the steps a lot: > > https://github.com/unbit/uwsgi-sse-offload nice. it certainly looks cleaner than having an external gevent process. does

Re: Feature: Support Server-Sent Events

2015-05-31 Thread Roberto De Ioris
> On Sat, May 30, 2015 at 4:19 PM, Florian Apolloner > wrote: >> ie how would it use Django's current featureset which is basically >> blocking >> everywhere… > > On Sat, May 30, 2015 at 4:40 PM, Emil Stenström wrote: >> The separate process would have none