3 ms·
Either way - how does the front end developer get into play? In a setup where the frontend is doing the rendering, you can give the frontend developer access t
by ArtTimeInvestor 5y ago
Either way - how does the front end developer get into play?
In a setup where the frontend is doing the rendering, you can give the frontend developer access to a directory with static assets that get output to the browser verbatim.
How do you give them the ability to "have a Django template filter" without them having the ability to mess with the rest of the backend? Or do you set up a second server that talks to the APIs of the first server?
- tyingq 5y agoI'm not in a Django shop, but I assume these problems exist anyway. Front-end developers probably also want access to templates, images and css that sit on a server. A template filter would be fairly static though, just converting json into python objects. How to give them access to the Django template itself would be the thing you would want to solve. Node.js seems to have considered some of this, since it's more common to co-mingle front/back end.
- ArtTimeInvestor 5y agoI am also not in a Django shop. 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.
- fwip 5y agoDjango 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.