Vue + Django: Combining Django Templates and Vue Single File Components without compromise
December 14, 2023
23 min
Free
single-file-components
templates
sfc
django
javascript
frontend
web-development
state-management
composition-api
pinia
Description
Django and Vue both have unique front-end strengths. Django’s context-driven template views offer rapid development directly from back-end model content. Vue’s modern reactive components provide powerful tools for building complex UIs within the rich JavaScript ecosystem.
This talk explores how to inject Vue SFCs directly into Django Templates, with no need for REST APIs, allowing targeted areas to be enriched with Vue while retaining the flexibility and convenience of Django Templates in the remainder. It covers combining Vue and Django without compromising their strengths, including integration of the latest updates to Vue like the Composition API and Pinia for state management.