inertia-django-vite-vue-minimal
inertia-django-vite-vue-minimal copied to clipboard
A minimal, working template for Inertia + Django + Vite + Vue.
Inertia + Django + Vite + Vue minimal template
A minimal, working template for Inertia + Django + Vite + Vue.
Technologies
- 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
How to install & run
-
Download the repo. You can either:
a. Clone the repo (without the git history):
npx degit https://github.com/mujahidfa/inertia-django-vite-vue-minimalb. 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
How to build for production
-
Set
DEBUG=Falsein 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