So a former co-worker with some help/guidance from me developed a component system on top of Django that sounds sorta like what you are all talking about. It's very complicated and I'm still not sure whether it was ultimately a good idea to use or not, but it does make some things very simple (and we have no plans to move away from it at this point after ~2 years of use). I'll post some snippets from our internal docs on it now and if people are interested, I can explain more and possibly open source it: Background: What?
Specialized class based views and sub-views, that facilitate: - Split page template into components, each of which can be POSTed to and/or updated via ajax. - View code and templates for full page view and ajax update is the same code. (DRY, though more data over the wire than some of the newer javascript frameworks) - Updating multiple parts of the page with a single request (example: POSTing to one component can cause dependent components to also be updated in the same request) - Built-in compatibility to handle no-js in most situations - Deferred loading of components, for performance <https://github.com/suekhim/brilliant/wiki/Component-Framework-(custom-django-view-framework)-Docs#background-why>Background: Why? - Complex site with lots of logged in user interactions where content should be easy to change dynamically - Slow connections overseas (minimize round trips and limit full page loads without sacrificing dev time too much) - Some may not even have JS? (Though we don't really cater to them that much anymore, this was a consideration originally and still mostly supported by default outside of where we use d3 and things like that for rendering certain things.) On Monday, June 1, 2015 at 12:55:08 AM UTC-7, Unai Zalakain wrote: > > Finally someone expressed my own feelings about it perfectly :D > > On Sun, May 31, 2015 at 08:32:18PM -0500, Joe Tennies wrote: > >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 is now > >quite stable and people rely on their APIs. Your bold ideas really need > to > >be tested by fire before they go into the Django proper. There's been > lots > >of discussion about a year ago to remove/reduce a lot of the contrib. > > > >Being in Django is where things go to die. Once an API is released to the > >public, it takes a fair amount of work to remove/change it. You don't > even > >want to know how long it took to get schema migrations into Django. South > >had been the defacto way for quite a few years. That stated, Andrew had > to > >make some changes to South due to design decisions that were made earlier > >in South. Before that, there was other projects like django-evolution > >(which just got an update 2 months ago). > > > >So, I followed the Drupal group for a while. The thing the Django > community > >really needs is a couple good opinionated groups of how to put together a > >good Django site. Drupal has Lullabot (who have quite a few core devs on > >staff). Django is not going to be the people telling people how to use > >Django. You seem like a great person to start this for Django. Note that > >you'll have to have a thick skin and create some pretty great sites in > your > >own right to prove out your ideas to others. You'll also need to get your > >ideas out via things like blog posts, tutorials, and podcasts. > > > >I would like the Caktus, DjangoCMS, FeinCMS, etc people to do the same. > >This would help people to see some different ideas on how to use and > extend > >Django. > > > >On Sun, May 31, 2015 at 5:26 AM, Emil Stenström <e...@kth.se > <javascript:>> wrote: > > > >> 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 separated. I think you are > >>> solving a > >>> > problem > >>> > for the one that just want to use a component but you are not > >>> solving the > >>> > problem for the one that is writing components. At least not in > the > >>> react.js > >>> > way, especially from such a bold premise :) > >>> > > >>> > I agree that I don't quite do it the same way as React. But that's > not > >>> the point > >>> > here either, to somehow bundle Reacts ideas inside Django. My point > is > >>> that > >>> > keeping the four parts that make a component closely together in the > >>> project > >>> > source, would make for a better structure. They only idea that comes > >>> from React > >>> > is thinking in components rather than nested templates and template > >>> tags, which > >>> > are Django's current way of solving this. > >>> > >>> I see, but who are going to do a big js app without using a framework > >>> like > >>> angular / react.js / ember / whatever? I'm not saying your Component > >>> proposal is > >>> without merit but i can't see how it can fit where the js app is done > >>> with a > >>> framework. > >>> > >> > >> The idea is simply to keep interface components together in the Django > >> project tree. That wouldn't change your options in regards to what > >> javascript framework to use, just give you some help with organizing > your > >> code. > >> > >> Say you decide to use React as just JS framework. Since React puts the > >> HTML inside your javascript your Django component would simply be: > >> > >> class ReactCalendar(component.Component): > >> def context(self, date): > >> return {"date": date} > >> class Media: > >> template = None > >> css = {'all': ('app/components/calendar/calendar.css',)} > >> js = ('app/components/calendar/calendar.js',) > >> > >> Since React doesn't handle CSS the component model would give you a way > of > >> tying thing together anyway. And with the component template tag you > would > >> be able to decide where to include your React component. > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups > >> "Django developers (Contributions to Django itself)" group. > >> To unsubscribe from this group and stop receiving emails from it, send > an > >> email to django-develop...@googlegroups.com <javascript:>. > >> To post to this group, send email to django-d...@googlegroups.com > <javascript:>. > >> Visit this group at http://groups.google.com/group/django-developers. > >> To view this discussion on the web visit > >> > https://groups.google.com/d/msgid/django-developers/a05f2dc1-3515-4b23-96f5-479d2722b82c%40googlegroups.com > > >> < > https://groups.google.com/d/msgid/django-developers/a05f2dc1-3515-4b23-96f5-479d2722b82c%40googlegroups.com?utm_medium=email&utm_source=footer> > > > >> . > >> > >> For more options, visit https://groups.google.com/d/optout. > >> > > > > > > > >-- > >Joe Tennies > >ten...@gmail.com <javascript:> > > > >-- > >You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > >To unsubscribe from this group and stop receiving emails from it, send an > email to django-develop...@googlegroups.com <javascript:>. > >To post to this group, send email to django-d...@googlegroups.com > <javascript:>. > >Visit this group at http://groups.google.com/group/django-developers. > >To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/CACiOJ6uz5f42vSQ_5A%2BU_GyUHSPuNrO6vWahGpzdbSH9cusFiQ%40mail.gmail.com. > > > >For more options, visit https://groups.google.com/d/optout. > > -- > unai > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/2bd4c2a6-92f4-43a9-b82d-cc5eaa350239%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.