
Integrate Django with Vue.js using minimal third-party packages, keep Django concise, and let Vue.js adopt new technologies, by running in one repo with a Django backend and Vue built files.
Learn the recommended requirements for the Django x Vue.js project, including Python 3.8+ and Node.js, with yarn. Start by creating a Django virtual environment.
Build a Django backend with a Python 3.11 virtual environment, activate it, create a CRC project, install Django via requirements, and start a Django project named home for Vue.js integration.
begin a vue.js project using the official setup, configure dev and prod builds to django static, and integrate with django to serve the index file.
Configure Django to serve static files in development with static files dirs and a local CDN, then prepare production using Django storages with S3 or other providers.
Learn how to configure a custom Django context processor to inject Vue.js static file paths into templates via a base template, enabling dynamic loading of static assets.
Learn to use pathlib to dynamically set static asset paths in a Django and Vue.js project, including globbing JavaScript and CSS files and toggling dev and prod settings.
Mount a Vue.js app inside a Django template by targeting the div id app and creating the app with createApp, passing data via the element dataset for Django context.
Demonstrate passing dataset values as props in a Vue.js app, define token and user props with the setup composition API, and unpack data for streamlined token access.
Learn vue state management with ref to track a count and token across components, bind click events, and update the UI without reloading the page.
Build a simple global state in Vue using a reactive store to hold a token and a counter, accessible across components and used for API requests.
Create a Vue single-page component that performs an API get request to a Django endpoint and updates title and content from the JSON response.
Create a Django API view that returns serialized content as JSON via a relative URL, then integrate with Vue.js, handling get and preparing for post with csf token.
Replace fetch with Axios in a Vue.js Django app, install Axios, import it, and handle responses with try-catch, inspecting response.status and response.data for success or error, including 404 not found.
Map an html input to a Vue ref with v-model, then build a simple form using reactive data for title and slug to send to the backend.
Explore how Vue's built-in v-on directive handles input events to dynamically update a title and slug, demonstrating event targets, reactive data, and basic slugification.
Post reactive form data from a Vue.js front end to a Django back end using Axios. Submit the form with a token header and JSON payload, then handle API response.
Create a Django API view to handle post requests for API posts, return JSON responses, validate input, and note when to use Django Rest Framework for validation.
Learn to convert a Vue view into a functional HTML form, handle the submit event, prevent defaults, gather form data with FormData, and convert it to JSON for backend integration.
Create a Django model and a model form for title, slug, and content, register admin, run migrations, and expose an API endpoint for Vue submissions with validation.
Explore how to integrate Vue with Django's authentication, sessions, and caching, using CSRF tokens for safe requests and accessing the logged-in user in the backend.
Django is one of the most popular backend web application frameworks that exists and it's written in Python. Vue.js is one of the most popular JavaScript tools for adding dynamic features to a web application.
Django doesn't need Vue to run. Vue doesn't need Django to run. The combination gives developers an incredibly flexible and dynamic paradigm while also leveraging a number of the built-in benefits that each tool has.
Django is excellent because it's open source, has built-in user management, built-in database integrations, and built-in security measures. There's features make it not only the best Python-based web framework but the best framework across all programming languages. I love tools like Flask, FastAPI, Express.js, Adonis.js, but none of them have the ease of implementation and the built-in features like Django.
Vue.js has quickly become my go-to for JavaScript frameworks. This is for two reasons: (1) The <template> / <script> syntax is very intuitive and reminds me a lot of a 100x better version of jQuery. (2) You can make incredibly small components really quickly and simply.
This course is not meant to be comprehensive in using Vue or Django but rather show you the best and most modern approach to integrating the two tools. Here's exactly what we're going to cover:
Develop Django & Vue.js simultaneously
Limit third-party package usage (no Python-based JavaScript compilers here)
Leverage Django Templates with Vue.js
Implement Cross Site Request Forgery (csrf) safely
Dynamically load file paths with Pathlib
Use custom Django Template Context Processors
CRUD from Vue.js to Django without additional API frameworks (such as Django Rest Framework)
Use Vite to build and compile our Vue.js application
And more
The goal of this course is to build a practical and forward-thinking approach to integrate nearly any JavaScript library with your Django project. While you can take Vue.js and Django many places, having this type of integration will help you get there.
Recommended Experience
One of my Try Django courses or my Your First Django project course or similar
Python fundamentals (classes, functions, string formatting, etc)
JavaScript fundamentals (classes, functions, string formatting, etc)
HTML / CSS Basics (divs, inputs, styles, etc)