4 ms·
I don't think that many people care about server-side templating anymore. Some excellent JS frameworks has done away with that.
by bfwi 12y ago
I don't think that many people care about server-side templating anymore. Some excellent JS frameworks has done away with that.
- marcosscriven 12y agoI'm really curious why you say that? Certainly it seems to me there's enough downsides to client side rendering still that I can't see how it's that clear cut.
- tragic 12y agoWell, restricting the server to basically providing a REST API for client code is basically the dominant way of doing certain sorts of applications, particularly those that may have web and native implementations and so forth. Some of us, however, make websites. We generally render our HTML server side. And Django templates are as good a way as any other (leaving aside speed concerns).
- stdbrouw 12y agoWriting a template in one go, all in one file, is still vastly easier to wrap your head around than writing all sorts of different components in JavaScript and then gluing them together. There's great JS templating frameworks, but I don't see why anyone would use them unless you really have to, e.g. for data binding / dynamic changes to the DOM.
- untothebreach 12y agoI think that is a bit of confirmation bias. Client-side rendering has definitely garnered a lot of attention lately, but that doesn't mean that everyone has simultaneously stopped doing server-side rendering
- andybak 12y agoYep. There are times when server-side is the right thing to do (mainly content-based sites - especially if SEO and accessibility are major concerns) and times when client side is (SPAs and the more 'app-like' end of the spectrum). PJAX is a great compromise between the two approaches: https://github.com/jacobian/django-pjax https://github.com/jacobian/django-pjax https://readthedocs.org/projects/django-easy-pjax/ https://readthedocs.org/projects/django-easy-pjax/