Re: Feature: Template Components

2015-06-02 Thread Sam Solomon
If someone actually wants to use it I can set aside some time within the next week or two to actually open source the whole thing (docs + source on github/pypi). Here is an example of some of the basic functionality though: *What the following code does:* Creates a page for taking attendance of s

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

2015-06-02 Thread Lee Trout
I don't want to add any noise here- but I just had a chance to glance over this conversation and I've basically been doing what Carl describes with Angular. (In fact I joke often about calling it Djangular). I have a view that prerenders angular templates (accepts the path to the template in the ur

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

2015-06-02 Thread Emil Stenström
On Tuesday, 2 June 2015 20:31:41 UTC+2, Carl Meyer wrote: > > On 06/02/2015 11:53 AM, Emil Stenström wrote: > > I would love to see some code here if you have it available? How do you > > pass the JSON and the templates from the view to the client side? > > I don't have code I can share at the m

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

2015-06-02 Thread Carl Meyer
Hi Emil, On 06/02/2015 11:53 AM, Emil Stenström wrote: > On Tuesday, 2 June 2015 19:06:35 UTC+2, Carl Meyer wrote: > Using Jinja2 on the server and nunjucks on the client with shared > templates works very well, is quite easy, and doesn't require > Node.js on > the server. I've bee

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

2015-06-02 Thread Emil Stenström
On Tuesday, 2 June 2015 19:06:35 UTC+2, Carl Meyer wrote: > > On 06/02/2015 05:54 AM, Aymeric Augustin wrote: > > Using Jinja2 on the server and nunjucks on the client with shared > templates works very well, is quite easy, and doesn't require Node.js on > the server. I've been using this c

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

2015-06-02 Thread Bobby Mozumder
> On Jun 2, 2015, at 2:43 AM, Emil Stenström wrote: > > On Tuesday, 2 June 2015 05:19:43 UTC+2, Bobby Mozumder wrote: > At this point it’s probably easiest for Django to provide templates only for > Javascript front-end, and for Django to only serve API endpoints. > > We really don’t need Dja

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

2015-06-02 Thread Andrew Ingram
I feel we're getting a bit derailed here, but it seems I didn't explain what I was doing well enough. I'm saying that in both approaches I've used, I was authoring an isomorphic React application - i.e. returning a fully-rendered html document with all the React checksum IDs pre-populated. In my f

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

2015-06-02 Thread Emil Stenström
On Tuesday, 2 June 2015 13:54:44 UTC+2, Aymeric Augustin wrote: > > 2015-05-30 17:52 GMT+01:00 Emil Stenström >: > >> But what needs to happen is that the same templates that Django uses >> needs to be accessible to, and executable in, javascript. >> >> For this to work, two things needs to be bui

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

2015-06-02 Thread Emil Stenström
On Tuesday, 2 June 2015 12:58:22 UTC+2, Andrew Ingram wrote: > > Based on my own experiences building isomorphic JavaScript apps with > Django, I haven't had any issues where I felt Django was getting in my way. > I've tackled the problem in two different ways, both of which worked > without any

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

2015-06-02 Thread Carl Meyer
On 06/02/2015 05:54 AM, Aymeric Augustin wrote: > 2015-05-30 17:52 GMT+01:00 Emil Stenström mailto:e...@kth.se>>: [snip] > 2. A template language that has a solid javascript implementation. > To be able to render the templates the server side and client side > must use the same language

Re: Feature: Support Server-Sent Events

2015-06-02 Thread Emil Stenström
Hi, On Tuesday, 2 June 2015 11:25:14 UTC+2, Andrew Godwin wrote: > > Hi Emil, > > I agree that there perhaps needs to be a more "pull" here than just making > a third party app, but I feel I can speak from a good place when I say > third party apps can absolutely prove core Django features in a

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

2015-06-02 Thread Aymeric Augustin
2015-06-02 12:54 GMT+01:00 Aymeric Augustin < aymeric.augus...@polytechnique.org>: > implement a template engine that hands over data to a Node.js process, > lets it render the template, gets the HTML back, and returns it. If someone wants to try this, https://github.com/markfinger/python-react

Re: URL namespaces

2015-06-02 Thread Marten Kenbeek
The admin proves problematic. Looking at the uses of `AdminSite.name`, it's not easily replaced. There are quite a few places that use the name to reverse urls, but don't have access to the request and the current namespace. I think the best solution for now is to document that you should pass

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

2015-06-02 Thread Aymeric Augustin
Hello Emil, 2015-05-30 17:52 GMT+01:00 Emil Stenström : > But what needs to happen is that the same templates that Django uses needs > to be accessible to, and executable in, javascript. > > For this to work, two things needs to be built: > > 1. A way to access the template and the template conte

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

2015-06-02 Thread Andrew Ingram
Based on my own experiences building isomorphic JavaScript apps with Django, I haven't had any issues where I felt Django was getting in my way. I've tackled the problem in two different ways, both of which worked without any great difficulty: 1. The primary web-app is actually a node process. Eve

Re: Feature: Support Server-Sent Events

2015-06-02 Thread Andrew Godwin
Hi Emil, I agree that there perhaps needs to be a more "pull" here than just making a third party app, but I feel I can speak from a good place when I say third party apps can absolutely prove core Django features in a way that gives them much faster release cycles and freedom from things like LTS

Re: Idea: Better support for javascript heavy sites

2015-06-02 Thread Emil Stenström
My conclusions to all the feedback in the three different threads are this: - You don't agree about the general need to support heavier javascript apps "out of the box" in Django - You are open to discussion about specific features being added... - ... but to be considered here they f