3 ms·
The article mentioned this approach: "When you google for Django + Vue, most results will be focused on using Django for your backend and Vue for a separate fr
by rahimnathwani 7y ago
The article mentioned this approach:
"When you google for Django + Vue, most results will be focused on using Django for your backend and Vue for a separate frontend project."
There are times when this makes sense, but there are times when you just need to sprinkle a but of Vue magic onto part of your site, without turning the whole thing into an SPA.
- dtjones 7y agoYes it's possible to include external libraries into Django templates but I haven't seen a project like this that is maintainable
- rahimnathwani 7y agoI once developed a UI to enable a non-technical user to answer 20 multiple-choice questions about a video. Some of the UX requirements I teased out during the process: - easy to answer questions whilst watching the video - quick to navigate to a specific question - video visible at all times - short+long summary of each answer visible when answering a specific question - long description of question visible - can be operated using mouse or keyboard (on laptop/desktop) or touch (tablet) The rest of the site was regular Django, with a bit of jQuery here and there. I settled on: - a regular Django form, with a single field to accept the a json string of the actual answers (the questions might change in future) - a description of all the questions, descriptions, choices stored in a Django model, and sent to the page as json - Vue rendering part of the page (the bit with the category selectors, question text, choices, descriptions) Vue helped me deliver a pretty slick UI and didn't add any technical debt. (Not saying I didn't add any technical debt overall, just that the front-end part didn't contribute.)