But I don't think Django templates are safe in a way that they protect the backend from a clueless or malicious frontend developer. Even if they were, you would have to take great care that you do not expose dangerous functionality. So "give them access to the Django template itself" is not enough. You would have to have a whole security concept around it.
And that is not enough. How does the fronted dev create routes? How do they create views, which are the glue between the DB and the templates?
Node.js is a runtime, not a framework. It does not have routes, views or templates at all. So that comparison makes no sense.
No matter which backend framework you choose - you will have a lot more work to bring the frontend dev into the game if you do backend rendering.
Please be aware that I am not against backend rendering. I indeed think that backend rendering is the better approach! I just explain here why there is some appeal to developers to write the backend as an API and do the rendering on the frontend.
Django templates intentionally provide greatly limited functionality compared to full-python.
The idea is that you prepare the needed data in the "view," and then the template should be relatively dumb. If the template is causing any database/backend requests while rendering, that's generally a sign that you haven't put enough information into your view layer.
But I don't think Django templates are safe in a way that they protect the backend from a clueless or malicious frontend developer. Even if they were, you would have to take great care that you do not expose dangerous functionality. So "give them access to the Django template itself" is not enough. You would have to have a whole security concept around it.
And that is not enough. How does the fronted dev create routes? How do they create views, which are the glue between the DB and the templates?
Node.js is a runtime, not a framework. It does not have routes, views or templates at all. So that comparison makes no sense.
No matter which backend framework you choose - you will have a lot more work to bring the frontend dev into the game if you do backend rendering.
Please be aware that I am not against backend rendering. I indeed think that backend rendering is the better approach! I just explain here why there is some appeal to developers to write the backend as an API and do the rendering on the frontend.
reply