5 ms·
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 l
by mythrwy 7y 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".
- postpawl 7y agoCan’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 https://stackoverflow.com/a/56461472
- Stephen0xFF 7y ago... 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.