Hacker News new | ask | show | jobs
by mythrwy 2259 days ago
Well you "could" spit out data from the views as JSON into <script> blocks in the Django templates and they would play nicely together.

But then you would be limited to various manipulations of the initial data so "could" is certainly not "should".

2 comments

Can’t you also pass data into components by using server side templating to fill in props on the component?

Like this: https://stackoverflow.com/a/56461472

... and that's exactly why I used the word "perhaps" before should. On paper importing a front end framework to a template engine shouldn't be done if you're following software design principles KISS, minimalism, and reducing technical debt. You can always render initial data on server side and maybe you should as business logic lives there.