Answer the question
In order to leave comments, you need to log in
What is the best way to organize a website?
Advise what is better and more correct: to build a website (python) on the internal REST API (with subsequent data output to the user via AJAX) or to initially enter data into rendered templates and immediately issue everything to the user?
Answer the question
In order to leave comments, you need to log in
JS Rich-fronted is better because the client does not reload pages and resources - less traffic, faster response speed.
Let's say you can do it on Angular.js or Backbone and implement the JSON RESTful API, to document it, look towards Swagger - there are bindings to tastypie. And run the entire frontend on node.js through prerender.io so that robots have the ability to index pages normally.
Here "server or client templating" there have already been many, many holivars.
People have tried to write heterogeneous templating engines that run on both the server and the client, Jade for example. It can be quite difficult to maintain this, but no one forbids trying. Search robots index "without JS", or Google 2-3 times a week "with JS", which is actually a complete crap for SEO. I went the path of least resistance, first I did prerender in phantomjs, and then prerender.io came out and there was no limit to my happiness.
It is important to understand that node.js in this case is not rubber, and under heavy loads it is important to provide good http caching - the arrangement of if-modified-since, and etags. To do this, I use a specially modified nginx caching plugin. In general, support for http caching in rich frontends is now a very sore subject. It just doesn't exist, and that causes a lot of problems.
First, make a REST API and then just write views to them.
You don't even have to change the model code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question