A minimal, working template for Inertia + Django + Vite + Vue.
- Inertia - powered by the official Inertia.js Django Adapter
- Django v4.2
- Vite 5 - powered by Django Vite
- Vue 3
- TypeScript
- WhiteNoise - to serve static files
-
Download the repo. You can either:
a. Clone the repo (without the git history):
npx degit https://github.com/mujahidfa/inertia-django-vite-vue-minimal
b. Or, create a repo based on this template via the GitHub template generator.
-
Install required Python packages.
# Create and activate a virtual environment python3 -m venv .venv source .venv/bin/activate # Install required Python packages pip install -r requirements.txt
-
Install required Node.js packages.
npm install
-
Run the Vite dev server:
npm run dev
-
Run Django's default migrations:
python manage.py migrate
-
Run the Django dev server (in a separate terminal):
python manage.py runserver
-
Set
DEBUG=False
in settings.py.# In settings.py ... DEBUG=False ...
-
Build the JS/assets for production:
npm run build
-
Run
collectstatic
:rm -rf staticfiles/ python manage.py collectstatic
-
Run the Django server:
python manage.py runserver