News for hackers. Stuff that matters.
Re:Using VueJS Alongside Django by Stephen0xFF on Tuesday April 14, 2020 @06:12PM (#22872130)
I feel the only way these two will play nicely is swapping Django for a DRF approach. Vanilla JS could be, and perhaps should be, used in place of Vue for small use cases. There's no need for the extra abstraction when AJAX could work.
Re:Using VueJS Alongside Django by mythrwy on Tuesday April 14, 2020 @06:43PM (#22872382)
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".

Re:Using VueJS Alongside Django by postpawl on Tuesday April 14, 2020 @09:10PM (#22873396)
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

Re:Using VueJS Alongside Django by Stephen0xFF on Tuesday April 14, 2020 @11:59PM (#22874364)
... 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.
Re:Using VueJS Alongside Django by tkainrad on Wednesday April 15, 2020 @03:25AM (#22875396)
The thing is, some of my use cases are not that small but still contained to only parts of the project.

Also, jQuery always feels kinda hacky to me. I have a much better feeling with VueJS. Part of this could be owed to the fact that I work on Java Backends in my day job.