Skip to content

cmjatai/cmj4

Repository files navigation

django-vite-vue-starter

A starter project using Django, Vite and Vue where Vue is used inside Django templates instead of its own application.

This repository was created for my Vite tutorial series.

Introduction to Vite and how you can install it in a Django project. Uses the django-vite package to link Django templates with the Vite static file server.

Demonstrates Vite's Vue plugin and shows you how to set up a Vue app that is rendered in a Django template. Covers how to pass data from a Django view to a Vue component. Uses Single File Components.

How to use

  1. Create a virtual environment
python3 -m venv venv
  1. Activate your virtual environment
source venv/bin/activate
  1. Install requirements
pip install -r requirements.txt
  1. Run migrations
python manage.py migrate
  1. Start the Django development server
python manage.py runserver
  1. Start the vite server
npm run vite